Using array.sort like I should have been doing all along