Improved moving logic