Added allRecords query/fixed graph calculation