Updated for Google App Engine