made the motion detection smoother