code for Coursera's Web Applications Class