Added function to run motion checking