This is a version with updated touch x and touch y calculations