public void undo(){
		
		//if the is nothing on the undo-stack, we can not undo anything
		if(undo.size() == 0) return;
		
		//get the moves from the top of the stack
		int dx = undo.get(undo.size()-1).get(0);
		int dy = undo.get(undo.size()-1).get(1);
		int moved = undo.get(undo.size()-1).get(2); // 0 = did not move a box(brick), 1 = did move a box(brick)
		
		//add the undo to the redo-stack and remove it from the undo-stack
		redo.add(undo.remove(undo.size()-1));
		
		//x- and y-coordinates of the piece in front of player (might have been moved last time)
		int moveX = playerX + dx;
		int moveY = playerY + dy;
		
		//if the piece in front of player is a box(brick) and was moved, then move it back on top of the player
		if(level.get(moveY).get(moveX) instanceof Brick && moved == 1){
			//if the brick is on a goal, then add a new goal where the box(brick) is, else add a blank.
			if(((Brick) level.get(moveY).get(moveX)).getIsOnGoal()){
				level.get(moveY).set(moveX, new Goal());
			}else{
				level.get(moveY).set(moveX, new Blank());
			}
			//if the player is on a goal, then set the brick to be an a goal
			if(((Player) level.get(playerY).get(playerX)).getIsOnGoal()){
				level.get(playerY).set(playerX, new Brick(true));
			}else{
				level.get(playerY).set(playerX, new Brick(false));
			}
		//do not need to mova a piece, so we do not care about the piece in front of the player
		}else{
			//if the player is on a goal, add a goal where the player is, else add a blank
			if(((Player) level.get(playerY).get(playerX)).getIsOnGoal()){
				level.get(playerY).set(playerX, new Goal());
			}else{
				level.get(playerY).set(playerX, new Blank());
			}
		}
		//move the player one back. If the piece is a goal, then set the player to be on top of a goal.
		if(level.get(playerY-dy).get(playerX-dx) instanceof Goal){
			level.get(playerY-dy).set(playerX-dx, new Player(true));
		}else{
			level.get(playerY-dy).set(playerX-dx, new Player(false));
		}
		
		//update the player position
		playerX -= dx;
		playerY -= dy;
		
	}