faster sorting solution