public void moveMonster(){
		//xPos,yPos is the position the monster is going to move to
		int gridWidth, gridHeight, xPos, yPos;
		int[] direction = new int[2];
		Monster mon[][] = logicHandler.getMonsters();
		gridHeight = canvas.getGridHeight();
		gridWidth = canvas.getGridWidth();

		/* loops through all the monsters
		xOrig,yOrig is the position the monster is at right now */
		for (int xOrig = 0; xOrig < gridWidth; xOrig++) {	  
		    for (int yOrig = 0; yOrig < gridHeight; yOrig++) {
	        	  
	        	  if(mon[xOrig][yOrig]!=null){
	        		  // gets the direction of movement of the monster at xOrig, yOrig
	        		  direction = mon[xOrig][yOrig].getDirection(logicHandler.getPlayerPosition());
				  xPos = xOrig + direction[0];			      
				  yPos = yOrig + direction[1];
	        		  
	        		  if(logicHandler.movable(xPos, yPos,xOrig,yOrig)){
				      logicHandler.move(xPos, yPos,xOrig,yOrig);
				      canvas.moveMonster(xPos, yPos,logicHandler.getObject(xPos,yPos));
	        		  }else{
	        		      logicHandler.attack(xPos, yPos,xOrig,yOrig);
				      if(xPos>0 && xPos<=78 && yPos>0 && yPos<=20){
	        			  //display the you were attacked flag if the collision was with a player
	        			  if(logicHandler.getObject(xPos, yPos) instanceof Player){
					      canvas.monsterAttack();
					      canvas.moveHeroAnimated(x, y, logicHandler.getPlayer().getHitPoints(), logicHandler.getPlayer().getAttack(),
					      						  logicHandler.getPlayer().getSpeed(), logicHandler.getLevel(),logicHandler.getPlayer().getScore());
	        			  }
	        			  canvas.moveMonster(xOrig, yOrig,logicHandler.getObject(xOrig,yOrig));
					  
				      }
	        		  }
	        	  }
		    }
		}
		//update the monster list in logic handler
		logicHandler.storeMonsters();
		fillEmptySpace();
	}