Moved movement code into it's own method