added Sinatra partials and fixed sorting