Sorting JS for heroku