recoded for touch position instead of mouse