added patient looking of records and fixed an ordering bug in the records