switched to sorting algorithm with all records read;