changes to control position and added touch events