Fixed some functions and edited the touchend function