Use reduce rather than iterate in the move function

This seems more appropriate. It avoids having to manage the coordinate
list manually, and having to determine when the move is finished.