code to run on the laptop for motion detection