get gesture stuff added to gamedemo
clean up the code and add comments