motion detect

improved motion detection