add clicking function to mouse position. flatlines when out of bounds