Rewrite all movement code