reworked and cleaned up touch processing