semi working version - overreacts and doesn't deal gracefully with losing motion
mostly working