public void paint(Graphics g) {
        // loop through all the tiles in the map rendering them
        // based on whether they block or not
        for (int x = 0; x < HEIGHT; x++) {
            for (int y = 0; y < WIDTH; y++) {

                // so if the cell is blocks, draw a light grey block
                // otherwise use a dark gray
                if (data[x][y] == MARKED) {
                    g.setColor(Color.gray);
                    // draw the rectangle with a dark outline
                    g.fillRect(y * TILE_SIZE, x * TILE_SIZE, TILE_SIZE, TILE_SIZE);
                    g.setColor(g.getColor().darker());
                    g.drawRect(y * TILE_SIZE, x * TILE_SIZE, TILE_SIZE, TILE_SIZE);

                    g.setColor(Color.red);
                    g.fillOval((int) y * TILE_SIZE + 5, (int) x * TILE_SIZE + 5, TILE_SIZE / 2, TILE_SIZE / 2);

                } else if (data[x][y] == EXIT_FOUND || data[x][y] == EXIT) {
                    g.setColor(Color.blue);
                    // draw the rectangle with a dark outline
                    g.fillRect(y * TILE_SIZE, x * TILE_SIZE, TILE_SIZE, TILE_SIZE);
                    g.setColor(Color.gray);
                    g.drawRect(y * TILE_SIZE, x * TILE_SIZE, TILE_SIZE, TILE_SIZE);
                    if (data[x][y] == EXIT_FOUND) {
                        g.setColor(Color.red);
                        g.fillOval((int) y * TILE_SIZE + 5, (int) x * TILE_SIZE + 5, TILE_SIZE / 2, TILE_SIZE / 2);
                    }
                } else if (data[x][y] == CURRENT_POS) {
                    g.setColor(Color.gray);
                    // draw the rectangle with a dark outline
                    g.fillRect(y * TILE_SIZE, x * TILE_SIZE, TILE_SIZE, TILE_SIZE);
                    g.setColor(g.getColor().darker());
                    g.drawRect(y * TILE_SIZE, x * TILE_SIZE, TILE_SIZE, TILE_SIZE);
                    g.setColor(Color.YELLOW);
                    g.fillOval((int) y * TILE_SIZE + 5, (int) x * TILE_SIZE + 5, TILE_SIZE / 2, TILE_SIZE / 2);
//                    //draw the current pos as an arrow
//                    double dx = x - _lastX;
//                    double dy = y - _lastY;
//
//                    double angle = Math.atan2(dy, dx) * 180 / Math.PI;
//                    _lastX = x;
//                    _lastY = y;
//                    if (DEBUG) {
//                        if (angle >= 0 && angle <= 45) {
//                            System.out.println("RIGHT");
//                        }
//                        if (angle > 45 && angle <= 90) {
//                            System.out.println("UP");
//                        }
//                         if (angle >90 && angle <= 180) {
//                            System.out.println("LEFT");
//                        }
//                        if (angle >= -90 && angle == 0) {
//                            System.out.println("DOWN");
//                        }
//                    }
//
//                    int[] xList = {(int) y * TILE_SIZE + 5, (int) y * TILE_SIZE + 10, (int) y * TILE_SIZE + 15};
//                    int[] yList = {(int) x * TILE_SIZE + 2, (int) x * TILE_SIZE + 15, (int) x * TILE_SIZE + 2};
//                    g.setColor(Color.red);
//                    g.fillPolygon(xList, yList, 3);
                } else {
                    g.setColor(Color.gray);
                    if (data[x][y] == BLOCKED) {
                        g.setColor(Color.DARK_GRAY);
                    }

                    // draw the rectangle with a dark outline
                    g.fillRect(y * TILE_SIZE, x * TILE_SIZE, TILE_SIZE, TILE_SIZE);
                    g.setColor(g.getColor().darker());
                    g.drawRect(y * TILE_SIZE, x * TILE_SIZE, TILE_SIZE, TILE_SIZE);
                }
            }
        }
    }