pack rects algo, deployed to Google App Engine