basically finished the touch function