Movement function complete. Probably has bugs.