Refactored bug.py to allow for a trivial aggregation function