Updated movement.c

Completed Zach's proposed changes;
Used excessive casting in most functions so that the compiler should not complain;