tweaks to make it run on App Engine