Clarified some text and cleaned up some code

Notably, the aggregate function call
Still exploring using data.table to aggregate faster