private Position getPosOnDirection(Position pos, Direction direction) {
        Position p = pos.copy();
        if (direction.equals(Direction.UP)) {
            p.setY(p.getY() - 1);
        } else if (direction.equals(Direction.DOWN)) {
            p.setY(p.getY() + 1);
        } else if (direction.equals(Direction.LEFT)) {
            p.setX(p.getX() - 1);
        } else if (direction.equals(Direction.RIGHT)) {
            p.setX(p.getX() + 1);
        }
        return p;

    }