Fixes to code; note that data structure of mock data has changed and therefore, this code breaks without new mock data file