finished up touch events and cleaned up some javascript