Doing a little refactoring, got rid of the shoddy CPM calculations