added event handler and cleaned up touch sample