private String getNextRecordByHeapScan() throws IOException {
		RandomAccessFile file = heapFile.randomAccessFile;
		long numberOfRecords= this.header.getTotalRecords();
		int sizeOfRecord = this.header.getSizeOfRecord();
		byte[] buf = null;
		boolean haveRecord = false;

		if (this.nextRecord > numberOfRecords)
			return null;
		
		outer:
			while(this.nextRecord <= numberOfRecords) {
				file.seek(nextRecordOffset);
				buf = new byte[sizeOfRecord];
				file.read(buf);
				this.nextRecordOffset += sizeOfRecord;
				this.nextRecord++;
				int offset = 0;
				int attributeNumber = 1;

				for (Attribute attribute: schema) {
					int size = attribute.getSize();
					char type = attribute.getType();
					int attributeCode = Utilities.getIntDatatypeCode(type, size);

					for (Condition condition : selectionList) {
						if (condition.column != attributeNumber) 
							continue;
						byte[] byteFormat = getAsByteArray(type, condition, size);
						int result = types[attributeCode].compare(buf, offset, 
								byteFormat, 
								0, size);

						if (!satisfyCondition(result, condition.operation)){
							continue outer;
						}

					}
					offset += size;
					attributeNumber++;
				}
				/* 
				 * If you got here, it means you went through all conditions on 
				 * all attributes and they all passed. You have a valid record. 
				 * Break the while loop.
				 */
				haveRecord = true;
				break;
			}
		
		if (!haveRecord)
			return null;

		if (this.projectionList.isEmpty())
			return project(buf, null);
		else 
			return project(buf, this.projectionList);
	}