Added a function to retrieve the position data of the thumb and restructured the onUpdate function to do this