private void loadFile(){
		BufferedInputStream bis;
		
		try {
			bis = new BufferedInputStream(new FileInputStream(file));
			byte[] data;
			
			for(int i : this.pieces.keySet()){
				Piece p = pieces.get(i);
				int offset = 0 - Piece.MAX_BLOCK_LENGTH;
				data = new byte[p.getLength()];
				bis.read(data);
				//System.out.println("loading piece: " + p.getIndex());
				
				for(int j = 0; j < p.getNumBlocks(); j++){
					offset += Piece.MAX_BLOCK_LENGTH; //on first iteration it should become 0
					byte[] blockData = new byte[p.getBlockLength(offset)];
					
					
					for(int k = 0; k<blockData.length;k++)
						blockData[k] = data[offset+k];
						
					Block b = new Block(p.getIndex(), offset, blockData);
					//System.out.println(" -> block: " + offset);
					p.saveBlock(b);
				}
				
				if(p.complete()){
					this.recieved[p.getIndex()] = true;
					completedPieceCount++;
				}
				
				
			}
		//saveFile();
		
		
		
		} catch (FileNotFoundException e) {
			System.err.println("This is akward. The file doesn't exist.");
			//e.printStackTrace();
		} catch (IOException e) {
			System.err.println("The Load has failed with message: "+e.getMessage());
			//e.printStackTrace();
		}
		
		
	}