Added simple motion detection