A better movement code