left mouse function and bounds checking on movement