public static boolean isPositionBetweenPositionsOnLine(int positionX, int positionA, int positionB) {

        // if positionX is not between other positions, it can't be between
        // them. Duh...
        boolean greaterThanBoth = (positionX > positionA) && (positionX > positionB);
        boolean lowertThanBoth = (positionX < positionA) && (positionX < positionB);

        if (greaterThanBoth || lowertThanBoth) { return false; }

        // all positions must be on same line
        boolean sameRank = (Utils.getRankFromPosition(positionX) == Utils.getRankFromPosition(positionA))
                && (Utils.getRankFromPosition(positionX) == Utils.getRankFromPosition(positionB));
        boolean sameFile = (Utils.getFileFromPosition(positionX) == Utils.getFileFromPosition(positionA))
                && (Utils.getFileFromPosition(positionX) == Utils.getFileFromPosition(positionB));

        if (sameFile || sameRank) {
            return true;
        }
        else {
            return false;
        }
    }