check on heroku
sorting the hash
removed some debugging stuff