check sorting while iterating over file.