public void loadPokemon()
	{
		String input ="savedata/"+idString+".pkmn";

		try
		{
			BufferedReader in = new BufferedReader(new FileReader(input));

			encryptionKey=0;

			Pokemon temp=new Pokemon(Pokemon.Species.BULBASAUR);

			String test=in.readLine();

			if(VERSION.charAt(0)!=test.charAt(0))
			{
				System.out.println("Invalid Pokemon data");
				System.exit(-1);
			}

			for(int i=0; i<partyPokemon.length; i++)
			{
				test=in.readLine();

				if(test.equals("null"))
				{
					test="";
				}
				else
				{
					//Header
					if(VERSION.charAt(0)!=test.charAt(0))
					{
						System.out.println("Invalid Pokemon data");
						System.exit(-1);
					}

					temp=new Pokemon(Pokemon.Species.BULBASAUR);

					//Strings
					temp.species=Pokemon.Species.valueOf(in.readLine());
					temp.nickname=in.readLine();
					temp.originalTrainer=in.readLine();
					temp.status=Pokemon.Status.valueOf(in.readLine());
					temp.substatus=Pokemon.Substatus.valueOf(in.readLine());
					temp.move[0]=Pokemon.Move.valueOf(in.readLine());
					temp.move[1]=Pokemon.Move.valueOf(in.readLine());
					temp.move[2]=Pokemon.Move.valueOf(in.readLine());
					temp.move[3]=Pokemon.Move.valueOf(in.readLine());

					//Integers
					temp.level=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.level;
					temp.exp=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.exp;
					temp.health=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.health;
					temp.healthMax=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.healthMax;
					temp.HP_EV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.HP_EV;
					temp.ATK_EV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.ATK_EV;
					temp.DEF_EV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.DEF_EV;
					temp.SPCL_EV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.SPCL_EV;
					temp.SPEED_EV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.SPEED_EV;
					temp.HP_IV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.HP_IV;
					temp.ATK_IV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.ATK_IV;
					temp.DEF_IV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.DEF_IV;
					temp.SPCL_IV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.SPCL_IV;
					temp.SPEED_IV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.SPEED_IV;
					temp.TRUE_PP[0]=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.TRUE_PP[0];
					temp.TRUE_PP[1]=Integer.parseInt(in.readLine(),2);
					temp.TRUE_PP[2]=Integer.parseInt(in.readLine(),2);
					temp.TRUE_PP[3]=Integer.parseInt(in.readLine(),2);
					temp.TRUE_PPMAX[0]=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.TRUE_PPMAX[0];
					temp.TRUE_PPMAX[1]=Integer.parseInt(in.readLine(),2);
					temp.TRUE_PPMAX[2]=Integer.parseInt(in.readLine(),2);
					temp.TRUE_PPMAX[3]=Integer.parseInt(in.readLine(),2);

					//Booleans
					temp.IS_TRADED=Boolean.parseBoolean(in.readLine());

					partyPokemon[i]=new  Pokemon(temp.species, temp.move[0], temp.move[1], temp.move[2], temp.move[3], temp.level,
					temp.HP_IV,  temp.ATK_IV, temp.DEF_IV, temp.SPCL_IV, temp.SPEED_IV,
					temp.nickname, temp.status, temp.idNumber, temp.originalTrainer);

					partyPokemon[i].setEV("HP",temp.HP_EV);
					partyPokemon[i].setEV("ATK",temp.ATK_EV);
					partyPokemon[i].setEV("DEF",temp.DEF_EV);
					partyPokemon[i].setEV("SPCL",temp.SPCL_EV);
					partyPokemon[i].setEV("SPEED",temp.SPEED_EV);

					partyPokemon[i].health=temp.health;
					partyPokemon[i].healthMax=temp.healthMax;
					partyPokemon[i].exp=temp.exp;

					partyPokemon[i].TRUE_PP[0]=temp.TRUE_PP[0];
					partyPokemon[i].TRUE_PP[1]=temp.TRUE_PP[1];
					partyPokemon[i].TRUE_PP[2]=temp.TRUE_PP[2];
					partyPokemon[i].TRUE_PP[3]=temp.TRUE_PP[3];

					partyPokemon[i].TRUE_PPMAX[0]=temp.TRUE_PPMAX[0];
					partyPokemon[i].TRUE_PPMAX[1]=temp.TRUE_PPMAX[1];
					partyPokemon[i].TRUE_PPMAX[2]=temp.TRUE_PPMAX[2];
					partyPokemon[i].TRUE_PPMAX[3]=temp.TRUE_PPMAX[3];
				}
			}

			for(int i=0; i<pcPokemon.length; i++)
			{
				test=in.readLine();

				if(test.equals("null"))
				{
					test="";
				}
				else
				{
					//Header
					if(VERSION.charAt(0)!=test.charAt(0))
					{
						System.out.println("Invalid Pokemon data");
						System.exit(-1);
					}

					temp=new Pokemon(Pokemon.Species.BULBASAUR);

					//Strings
					temp.species=Pokemon.Species.valueOf(in.readLine());
					temp.nickname=in.readLine();
					temp.originalTrainer=in.readLine();
					temp.status=Pokemon.Status.valueOf(in.readLine());
					temp.substatus=Pokemon.Substatus.valueOf(in.readLine());
					temp.move[0]=Pokemon.Move.valueOf(in.readLine());
					temp.move[1]=Pokemon.Move.valueOf(in.readLine());
					temp.move[2]=Pokemon.Move.valueOf(in.readLine());
					temp.move[3]=Pokemon.Move.valueOf(in.readLine());

					//Integers
					temp.level=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.level;
					temp.exp=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.exp;
					temp.health=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.health;
					temp.healthMax=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.healthMax;
					temp.HP_EV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.HP_EV;
					temp.ATK_EV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.ATK_EV;
					temp.DEF_EV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.DEF_EV;
					temp.SPCL_EV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.SPCL_EV;
					temp.SPEED_EV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.SPEED_EV;
					temp.HP_IV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.HP_IV;
					temp.ATK_IV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.ATK_IV;
					temp.DEF_IV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.DEF_IV;
					temp.SPCL_IV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.SPCL_IV;
					temp.SPEED_IV=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.SPEED_IV;
					temp.TRUE_PP[0]=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.TRUE_PP[0];
					temp.TRUE_PP[1]=Integer.parseInt(in.readLine(),2);
					temp.TRUE_PP[2]=Integer.parseInt(in.readLine(),2);
					temp.TRUE_PP[3]=Integer.parseInt(in.readLine(),2);
					temp.TRUE_PPMAX[0]=Integer.parseInt(in.readLine(),2);
						encryptionKey+=temp.TRUE_PPMAX[0];
					temp.TRUE_PPMAX[1]=Integer.parseInt(in.readLine(),2);
					temp.TRUE_PPMAX[2]=Integer.parseInt(in.readLine(),2);
					temp.TRUE_PPMAX[3]=Integer.parseInt(in.readLine(),2);

					//Booleans
					temp.IS_TRADED=Boolean.parseBoolean(in.readLine());

					pcPokemon[i]=new  Pokemon(temp.species, temp.move[0], temp.move[1], temp.move[2], temp.move[3], temp.level,
					temp.HP_IV,  temp.ATK_IV, temp.DEF_IV, temp.SPCL_IV, temp.SPEED_IV,
					temp.nickname, temp.status, temp.idNumber, temp.originalTrainer);

					pcPokemon[i].setEV("HP",temp.HP_EV);
					pcPokemon[i].setEV("ATK",temp.ATK_EV);
					pcPokemon[i].setEV("DEF",temp.DEF_EV);
					pcPokemon[i].setEV("SPCL",temp.SPCL_EV);
					pcPokemon[i].setEV("SPEED",temp.SPEED_EV);

					pcPokemon[i].health=temp.health;
					pcPokemon[i].healthMax=temp.healthMax;
					pcPokemon[i].exp=temp.exp;

					pcPokemon[i].TRUE_PP[0]=temp.TRUE_PP[0];
					pcPokemon[i].TRUE_PP[1]=temp.TRUE_PP[1];
					pcPokemon[i].TRUE_PP[2]=temp.TRUE_PP[2];
					pcPokemon[i].TRUE_PP[3]=temp.TRUE_PP[3];

					pcPokemon[i].TRUE_PPMAX[0]=temp.TRUE_PPMAX[0];
					pcPokemon[i].TRUE_PPMAX[1]=temp.TRUE_PPMAX[1];
					pcPokemon[i].TRUE_PPMAX[2]=temp.TRUE_PPMAX[2];
					pcPokemon[i].TRUE_PPMAX[3]=temp.TRUE_PPMAX[3];
				}
			}

			int keygen=Integer.parseInt(in.readLine());

			if(encryptionKey!=keygen)
			{
				System.out.println("Data has been manipulated. Exiting.");
				System.exit(-1);
			}
		}
		catch(Exception e)
		{
			System.out.println("Pokemon data has been manipulated or is not present.");
		}

		testEncryption(input);

		System.out.println("Pokemon loaded successfully.");
	}