worked on truncation and sorting