Refactored duplicate code for method checking pieces do not skip over occupied positions.