public void paintComponent(Graphics g) {
    	//handles drawing the GUI
        super.paintComponent(g);
        for (ArrayList<Node> row: graph.rows){
        	//draws all the nodes in the AGraph
        	for (Node n: row) {
        		n.drawNode(g);
        	}
        }
        
        // prints instructions to the gui
        g.setColor(Color.BLACK);
        if (graph.start == null) {
        	g.drawString("Choose Source", 600, 50);
        } else if (graph.dest == null) {
        	g.drawString("Choose Destination", 600, 50);
        } else if (graph.run == true) {
        	//add more info here
        	g.drawString("Reset to run again", 600, 50);
        	g.drawString(("Visited Nodes: " + visits), 600, 70);
        	g.drawString(("Total Path Cost: " + pathCost), 600, 90);
        } else {
        	g.drawString("Draw Barriers and run when ready", 600, 50);
        }
        
        g.drawString(("Red = Source"), 600, 110);
        g.drawString(("Blue = Destination"), 600, 130);
        g.drawString(("Black = In Path"), 600, 150);
        g.drawString(("Green = Visited Node"), 600, 170);
        g.drawString(("Blue-Green = Inaccessible Node"), 600, 190);
        g.drawString(("Straight jump cost = 10"), 600, 210);
        g.drawString(("Diagonal jump cost = 14"), 600, 230);
        g.drawString(("Note: Cannot jump diagonally through inaccessible nodes"), 600, 250);
    }