Worked on generalizing sort method and implemented sort by name