sample code from class at HTML5DevConf