test notes and some changes to sorting