wrote code for creating df and for aggregating bins. needs some refactoring