make sure to move pieces that are stationary to avoid infinite loop