working trajectory on mouse click