use sorted function instead of sort() method for Composition