Improved movement detection