Corrected mistake using sort() but it should be reverse().