private ArrayList getPosition(Position from) {
        ArrayList positions = new ArrayList(6);
        // defining positions
        Position right = board[from.getY()][from.getX() + 1];
        Position rightJump = board[from.getY()][from.getX() + 2];
        Position left = board[from.getY()][from.getX() - 1];
        Position leftJump = board[from.getY()][from.getX() - 2];
        Position rightUp,rightUpJump, leftUp, leftUpJump, rightDown, rightDownJump, leftDown, leftJumpDown;       
        if (from.getY() % 2 == 1) {
            rightUp = board[from.getY() - 1][from.getX() + 1];
            rightUpJump = board[from.getY() - 2][from.getX() + 1];
            leftUp = board[from.getY() - 1][from.getX()];
            leftUpJump = board[from.getY() - 2][from.getX() - 1];
            rightDown = board[from.getY() + 1][from.getX() + 1];
            rightDownJump = board[from.getY() + 2][from.getX() + 1];
            leftDown = board[from.getY() + 1][from.getX()];
            leftJumpDown = board[from.getY() + 2][from.getX() - 1];
        } else {
            rightUp = board[from.getY() - 1][from.getX()];
            rightUpJump = board[from.getY() - 2][from.getX() + 1];
            leftUp = board[from.getY() -1][from.getX() - 1];
            leftUpJump = board[from.getY() -2][from.getX() - 1];
            rightDown = board[from.getY() + 1][from.getX()];
            rightDownJump = board[from.getY() + 2][from.getX() + 1];
            leftDown = board[from.getY() + 1][from.getX() - 1];
            leftJumpDown = board[from.getY() + 2][from.getX() - 1];
        }


        //if (to.isEmpty() && from != to) {
        //check the position on the left 
        if (left  != null ) {
            if (left.isEmpty()) {
                positions.add(left);
            } else if (leftJump != null && leftJump.isEmpty()) {
                positions.add(leftJump);
            }
        }
        //check the position on the right
        if (right != null) {
            if (right.isEmpty()) {
                positions.add(right);
            } else if (rightJump != null && rightJump.isEmpty()) {
                positions.add(rightJump);
            }
        }

        if (rightUp != null) {
            if (rightUp.isEmpty()) {
                positions.add(rightUp);
            } else if (rightUpJump != null && rightUpJump.isEmpty()) {
                positions.add(rightUpJump);
            }
        }

        if (leftUp != null) {
            if (leftUp.isEmpty()) {
                positions.add(leftUp);
            } else if (leftUpJump != null && leftUpJump.isEmpty()) {
                positions.add(leftUpJump);
            }
        }

        if (rightDown  != null) {
            if (rightDown.isEmpty()) {
                positions.add(rightDown);
            } else if (rightDownJump != null && rightDownJump.isEmpty()) {
                positions.add(rightDownJump);
            }
        }

        if (leftDown != null) {
            if (leftDown.isEmpty()) {
                positions.add(leftDown);
            } else if (leftJumpDown != null && leftJumpDown.isEmpty()) {
                positions.add(leftJumpDown);
            }
        }
        return positions;
    }