Movement detection logic: rough draft