added left and right motion detection to the project