Updated move detection, added click function