public static Point commandToDir(Command command) {
        Point p = new Point(0, 0);
        if (command == LEFT) {
            p.x = -1;
        } else if (command == LEFT_UP) {
            p.x = -1;
            p.y = -1;
        } else if (command == UP) {

            p.y = -1;
        } else if (command == RIGHT_UP) {
            p.x = 1;
            p.y = -1;
        } else if (command == RIGHT) {
            p.x = 1;

        } else if (command == RIGHT_DOWN) {
            p.x = 1;
            p.y = 1;
        } else if (command == DOWN) {

            p.y = 1;
        } else if (command == LEFT_DOWN) {
            p.x = -1;
            p.y = 1;
        }
        return p;
    }