Refactored to make use of moveWhileOnScreen's return value