public void onUpdate() {
	        Graphics g = surface.getGraphics();		//Create a new instance of Graphics (GUI platform)
	        
	        int width = surface.getWidth();
	        int height = surface.getHeight();
	        int rows = mySim.getGrid().getRows();
	        int cols = mySim.getGrid().getCols();
	        
	        for(Cell c : mySim.getGrid()){
	        	Color rectColor;
	        	if(c instanceof Obstacle)
	        		rectColor = Color.RED;		//Set an obstacle color to red
	        	else if(c instanceof Person)
	        		rectColor = Color.GREEN;	//Set a person color to green
	        	else if(c instanceof EmptyCell)
	        		rectColor = Color.WHITE;	//Set an empty cell color to white
	        	else if(c instanceof CrosswalkV)	//Define cases for vertical crosswalk
	        		if(CrosswalkController.getInstance().isCrosswalkOpen())
	        			rectColor = Color.YELLOW;	
	        		else
	        			rectColor = Color.RED;		
	        	else if(c instanceof CrosswalkH) 	//Define cases for horizontal crosswalk
	        		if(CrosswalkController.getInstance().isCrosswalkOpen())
	        			rectColor = Color.RED;
	        		else
	        			rectColor = Color.YELLOW;
	        	else
	        		rectColor = Color.GRAY;
	        	
	        	int row = c.getRow();
	        	int col = c.getCol();
	        	
	        	g.setColor(rectColor);
	        	int x1 = col*width/cols;
	        	int x2 =  (col+1)*width/cols;
	        	int y1 = row*height/rows;
	        	int y2 = (row+1)*height/rows;
	        	g.fillRect(x1,y1,x2-x1,y2-y1);
	        }
	        
	        
	        view.repaint(); //repaint the simulation with updated elements
		}