Implemented basic motion detection.