public static void gotoPreviousLevel(GameStateManager gsm){

		World cw = (World)gsm.getGameState(gsm.getCurrentState());

		if(index == 0){
			cw.getPlayer().setVector(4, 0);
			return;
		}

		//save world we are currently in
		Save.writeWorld(cw, index);
		Save.writePlayerData(cw.getPlayer());

		//get gametime to transfer to the new world and continue counting
		int time = cw.GameTime;

		//set a new world
		gsm.setState(GameStateManager.GAME);

		//increase index to indicate the new world's index
		index--;
		World nw = (World)gsm.getGameState(gsm.getCurrentState());

		nw.readFromSave(Save.getWorldData(index));

		//set gametime to continue counting
		nw.GameTime = time;
		
		for(int i = 0; i < nw.tileMap.getXRows(); i++)
			for(int j = 0; j < nw.tileMap.getYRows(); j++){
				if(nw.tileMap.getBlockID(i, j) == 6){
					nw.getPlayer().setPosition(i*32 - 16, j*32);
					nw.getPlayer().facingRight = false;
				}
			}
		Save.writeRandomParts();
	}