diff --git a/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/edu/uci/ics/hyracks/tests/btree/BTreeOperatorsTest.java b/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/edu/uci/ics/hyracks/tests/btree/BTreeOperatorsTest.java
index 646795f..43b97d1 100644
--- a/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/edu/uci/ics/hyracks/tests/btree/BTreeOperatorsTest.java
+++ b/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/edu/uci/ics/hyracks/tests/btree/BTreeOperatorsTest.java
@@ -1,7 +1,23 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.tests.btree;
 
 import java.io.DataOutputStream;
 import java.io.File;
+import java.io.RandomAccessFile;
 
 import org.junit.Test;
 
@@ -28,6 +44,7 @@
 import edu.uci.ics.hyracks.dataflow.std.file.FileScanOperatorDescriptor;
 import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
 import edu.uci.ics.hyracks.dataflow.std.file.IFileSplitProvider;
+import edu.uci.ics.hyracks.dataflow.std.misc.NullSinkOperatorDescriptor;
 import edu.uci.ics.hyracks.dataflow.std.misc.PrinterOperatorDescriptor;
 import edu.uci.ics.hyracks.dataflow.std.sort.InMemorySortOperatorDescriptor;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeCursor;
@@ -35,20 +52,28 @@
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeLeafFrameFactory;
 import edu.uci.ics.hyracks.storage.am.btree.api.IFieldAccessor;
 import edu.uci.ics.hyracks.storage.am.btree.api.IFieldAccessorFactory;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.dataflow.BTreeBulkLoadOperatorDescriptor;
+import edu.uci.ics.hyracks.storage.am.btree.dataflow.BTreeInsertUpdateDeleteOperatorDescriptor;
+import edu.uci.ics.hyracks.storage.am.btree.dataflow.BTreeRegistry;
 import edu.uci.ics.hyracks.storage.am.btree.dataflow.BTreeRegistryProvider;
 import edu.uci.ics.hyracks.storage.am.btree.dataflow.BTreeSearchOperatorDescriptor;
 import edu.uci.ics.hyracks.storage.am.btree.dataflow.BufferCacheProvider;
 import edu.uci.ics.hyracks.storage.am.btree.dataflow.IBTreeRegistryProvider;
 import edu.uci.ics.hyracks.storage.am.btree.dataflow.IBufferCacheProvider;
+import edu.uci.ics.hyracks.storage.am.btree.frames.MetaDataFrame;
 import edu.uci.ics.hyracks.storage.am.btree.frames.NSMInteriorFrameFactory;
 import edu.uci.ics.hyracks.storage.am.btree.frames.NSMLeafFrameFactory;
 import edu.uci.ics.hyracks.storage.am.btree.impls.BTree;
+import edu.uci.ics.hyracks.storage.am.btree.impls.BTreeOp;
 import edu.uci.ics.hyracks.storage.am.btree.impls.MultiComparator;
 import edu.uci.ics.hyracks.storage.am.btree.impls.RangePredicate;
 import edu.uci.ics.hyracks.storage.am.btree.impls.RangeSearchCursor;
 import edu.uci.ics.hyracks.storage.am.btree.types.Int32AccessorFactory;
 import edu.uci.ics.hyracks.storage.am.btree.types.UTF8StringAccessorFactory;
+import edu.uci.ics.hyracks.storage.common.buffercache.IBufferCache;
+import edu.uci.ics.hyracks.storage.common.file.FileInfo;
+import edu.uci.ics.hyracks.storage.common.file.FileManager;
 import edu.uci.ics.hyracks.tests.integration.AbstractIntegrationTest;
 
 public class BTreeOperatorsTest extends AbstractIntegrationTest {
@@ -77,7 +102,7 @@
                 new AbsoluteLocationConstraint(NC1_ID) });
         ordScanner.setPartitionConstraint(ordersPartitionConstraint);
 
-        InMemorySortOperatorDescriptor sorter = new InMemorySortOperatorDescriptor(spec, new int[] { 1 },
+        InMemorySortOperatorDescriptor sorter = new InMemorySortOperatorDescriptor(spec, new int[] { 0 },
                 new IBinaryComparatorFactory[] { UTF8StringBinaryComparatorFactory.INSTANCE }, ordersDesc);
         PartitionConstraint sortersPartitionConstraint = new ExplicitPartitionConstraint(new LocationConstraint[] {
                 new AbsoluteLocationConstraint(NC1_ID) });
@@ -89,7 +114,6 @@
 		IBufferCacheProvider bufferCacheProvider = new BufferCacheProvider();		
 		IBTreeRegistryProvider btreeRegistryProvider = new BTreeRegistryProvider();
         
-        // build first bulk load operator		
 		IFieldAccessorFactory[] fieldAccessorFactories = new IFieldAccessorFactory[3];
 		fieldAccessorFactories[0] = new UTF8StringAccessorFactory(); // key
 		fieldAccessorFactories[1] = new UTF8StringAccessorFactory(); // payload
@@ -99,7 +123,7 @@
 		IBinaryComparatorFactory[] comparatorFactories = new IBinaryComparatorFactory[keyLen];
 		comparatorFactories[0] = UTF8StringBinaryComparatorFactory.INSTANCE;		
 				
-        int[] keyFields = { 1 };
+        int[] keyFields = { 0 };
         int[] payloadFields = { 4, 5 };
         int btreeFileId = 0;
         
@@ -125,7 +149,7 @@
     		comparators[i] = comparatorFactories[i].createBinaryComparator();
     	}
     	
-        MultiComparator cmpA = new MultiComparator(comparators, fields);
+        MultiComparator cmp = new MultiComparator(comparators, fields);
 
         // try an ordered scan on the bulk-loaded btree
         BTree btreeA = btreeRegistryProvider.getBTreeRegistry().get(btreeFileId);
@@ -135,10 +159,9 @@
         try {
         	while (scanCursor.hasNext()) {
         		scanCursor.next();
-        		byte[] array = scanCursor.getPage().getBuffer().array();
-        		int recOffset = scanCursor.getOffset();                
-        		String rec = cmpA.printRecord(array, recOffset);
-        		System.out.println(rec);
+        		IFieldIterator fieldIter = scanCursor.getFieldIterator();                                
+                String rec = cmp.printRecord(fieldIter);
+                System.out.println(rec);
         	}
         } catch (Exception e) {
         	e.printStackTrace();
@@ -146,7 +169,7 @@
         	scanCursor.close();
         }                        
 	}
-	
+		
 	@Test
 	public void btreeSearchTest() throws Exception {
 		JobSpecification spec = new JobSpecification();
@@ -199,4 +222,220 @@
         spec.addRoot(printer);
         runTest(spec);
     }
+		
+	@Test
+	public void insertTest() throws Exception {
+		JobSpecification spec = new JobSpecification();
+		
+        FileSplit[] ordersSplits = new FileSplit[] {
+                new FileSplit(NC1_ID, new File("data/tpch0.001/orders-part1.tbl")) };
+        IFileSplitProvider ordersSplitProvider = new ConstantFileSplitProvider(ordersSplits);
+        RecordDescriptor ordersDesc = new RecordDescriptor(new ISerializerDeserializer[] {
+                UTF8StringSerializerDeserializer.INSTANCE, UTF8StringSerializerDeserializer.INSTANCE,
+                UTF8StringSerializerDeserializer.INSTANCE, UTF8StringSerializerDeserializer.INSTANCE,
+                UTF8StringSerializerDeserializer.INSTANCE, UTF8StringSerializerDeserializer.INSTANCE,
+                UTF8StringSerializerDeserializer.INSTANCE, UTF8StringSerializerDeserializer.INSTANCE,
+                UTF8StringSerializerDeserializer.INSTANCE });
+        
+        FileScanOperatorDescriptor ordScanner = new FileScanOperatorDescriptor(spec, ordersSplitProvider,
+                new DelimitedDataTupleParserFactory(new IValueParserFactory[] { UTF8StringParserFactory.INSTANCE,
+                        UTF8StringParserFactory.INSTANCE, UTF8StringParserFactory.INSTANCE,
+                        UTF8StringParserFactory.INSTANCE, UTF8StringParserFactory.INSTANCE,
+                        UTF8StringParserFactory.INSTANCE, UTF8StringParserFactory.INSTANCE,
+                        UTF8StringParserFactory.INSTANCE, UTF8StringParserFactory.INSTANCE }, '|'), ordersDesc);
+        PartitionConstraint ordersPartitionConstraint = new ExplicitPartitionConstraint(new LocationConstraint[] {
+                new AbsoluteLocationConstraint(NC1_ID) });
+        ordScanner.setPartitionConstraint(ordersPartitionConstraint);
+        
+        IBTreeInteriorFrameFactory interiorFrameFactory = new NSMInteriorFrameFactory();
+		IBTreeLeafFrameFactory leafFrameFactory = new NSMLeafFrameFactory();
+		
+		IBufferCacheProvider bufferCacheProvider = new BufferCacheProvider();		
+		IBTreeRegistryProvider btreeRegistryProvider = new BTreeRegistryProvider();
+		
+		// we will create a primary index and 2 secondary indexes
+		// first create fieldaccessors and comparators for primary index
+		IFieldAccessorFactory[] primaryFieldAccessorFactories = new IFieldAccessorFactory[6];
+		primaryFieldAccessorFactories[0] = new UTF8StringAccessorFactory(); // key
+		primaryFieldAccessorFactories[1] = new UTF8StringAccessorFactory(); // payload
+		primaryFieldAccessorFactories[2] = new UTF8StringAccessorFactory(); // payload
+		primaryFieldAccessorFactories[3] = new UTF8StringAccessorFactory(); // payload
+		primaryFieldAccessorFactories[4] = new UTF8StringAccessorFactory(); // payload
+		primaryFieldAccessorFactories[5] = new UTF8StringAccessorFactory(); // payload		
+		
+		int primaryKeyLen = 1;
+		IBinaryComparatorFactory[] primaryComparatorFactories = new IBinaryComparatorFactory[primaryKeyLen];
+		primaryComparatorFactories[0] = UTF8StringBinaryComparatorFactory.INSTANCE;		
+		
+		// construct a multicomparator for the primary index                
+        IFieldAccessor[] primaryFields = new IFieldAccessor[primaryFieldAccessorFactories.length];
+    	for(int i = 0; i < primaryFieldAccessorFactories.length; i++) {
+    		primaryFields[i] = primaryFieldAccessorFactories[i].getFieldAccessor();
+    	}
+    	
+    	IBinaryComparator[] primaryComparators = new IBinaryComparator[primaryComparatorFactories.length];
+    	for(int i = 0; i < primaryComparatorFactories.length; i++) {
+    		primaryComparators[i] = primaryComparatorFactories[i].createBinaryComparator();
+    	}
+    	
+        MultiComparator primaryCmp = new MultiComparator(primaryComparators, primaryFields);
+        
+        
+        // now create fieldaccessors and comparators for secondary indexes
+		IFieldAccessorFactory[] secondaryFieldAccessorFactories = new IFieldAccessorFactory[2];
+		secondaryFieldAccessorFactories[0] = new UTF8StringAccessorFactory(); // key
+		secondaryFieldAccessorFactories[1] = new UTF8StringAccessorFactory(); // key (key in primary index)
+		
+		int secondaryKeyLen = 2;
+		IBinaryComparatorFactory[] secondaryComparatorFactories = new IBinaryComparatorFactory[secondaryKeyLen];
+		secondaryComparatorFactories[0] = UTF8StringBinaryComparatorFactory.INSTANCE;
+		secondaryComparatorFactories[1] = UTF8StringBinaryComparatorFactory.INSTANCE;		
+		
+		// construct a multicomparator for the secondary indexes                
+        IFieldAccessor[] secondaryFields = new IFieldAccessor[secondaryFieldAccessorFactories.length];
+    	for(int i = 0; i < secondaryFieldAccessorFactories.length; i++) {
+    		secondaryFields[i] = secondaryFieldAccessorFactories[i].getFieldAccessor();
+    	}
+    	
+    	IBinaryComparator[] secondaryComparators = new IBinaryComparator[secondaryComparatorFactories.length];
+    	for(int i = 0; i < secondaryComparatorFactories.length; i++) {
+    		secondaryComparators[i] = secondaryComparatorFactories[i].createBinaryComparator();
+    	}
+    	
+        MultiComparator secondaryCmp = new MultiComparator(secondaryComparators, secondaryFields);
+        
+        // we create and register 3 btrees for in an insert pipeline being fed from a filescan op        
+        IBufferCache bufferCache = bufferCacheProvider.getBufferCache();
+        BTreeRegistry btreeRegistry = btreeRegistryProvider.getBTreeRegistry();        
+        FileManager fileManager = bufferCacheProvider.getFileManager();
+        
+        // primary index
+        int fileIdA = 3;
+        File fA = new File("/tmp/btreetestA.ix");
+        RandomAccessFile rafA = new RandomAccessFile(fA, "rw");                
+        FileInfo fiA = new FileInfo(fileIdA, rafA);
+        fileManager.registerFile(fiA);
+        BTree btreeA = new BTree(bufferCache, interiorFrameFactory, leafFrameFactory, primaryCmp);		
+		btreeA.create(fileIdA, leafFrameFactory.getFrame(), new MetaDataFrame());
+        btreeA.open(fileIdA);
+        btreeRegistry.register(fileIdA, btreeA);
+        
+        // first secondary index
+        int fileIdB = 4;
+        File fB = new File("/tmp/btreetestB.ix");
+        RandomAccessFile rafB = new RandomAccessFile(fB, "rw");   
+        FileInfo fiB = new FileInfo(fileIdB, rafB);
+        fileManager.registerFile(fiB);
+        BTree btreeB = new BTree(bufferCache, interiorFrameFactory, leafFrameFactory, secondaryCmp);		
+		btreeB.create(fileIdB, leafFrameFactory.getFrame(), new MetaDataFrame());
+        btreeB.open(fileIdB);
+        btreeRegistry.register(fileIdB, btreeB);
+        
+        // second secondary index
+        int fileIdC = 5;
+        File fC = new File("/tmp/btreetestC.ix");
+        RandomAccessFile rafC = new RandomAccessFile(fC, "rw");                
+        FileInfo fiC = new FileInfo(fileIdC, rafC);
+        fileManager.registerFile(fiC);
+        BTree btreeC = new BTree(bufferCache, interiorFrameFactory, leafFrameFactory, secondaryCmp);	
+		btreeC.create(fileIdC, leafFrameFactory.getFrame(), new MetaDataFrame());
+        btreeC.open(fileIdC);
+        btreeRegistry.register(fileIdC, btreeC);
+        
+                
+        // create insert operators
+        
+        // primary index
+        int[] keyFieldsA = { 0 };
+        int[] payloadFieldsA = { 1,2,3,4,5 };                
+        BTreeInsertUpdateDeleteOperatorDescriptor insertOpA = new BTreeInsertUpdateDeleteOperatorDescriptor(spec, ordersSplitProvider, ordersDesc, bufferCacheProvider, btreeRegistryProvider, fileIdA, "/tmp/btreetestA.ix", interiorFrameFactory, leafFrameFactory, primaryFieldAccessorFactories, primaryComparatorFactories, keyFieldsA, payloadFieldsA, BTreeOp.BTO_INSERT);
+        PartitionConstraint insertPartitionConstraintA = new ExplicitPartitionConstraint(new LocationConstraint[] { new AbsoluteLocationConstraint(NC1_ID) });
+        insertOpA.setPartitionConstraint(insertPartitionConstraintA);
+        
+        // first secondary index
+        int[] keyFieldsB = { 3, 0 };
+        int[] payloadFieldsB = { };                
+        BTreeInsertUpdateDeleteOperatorDescriptor insertOpB = new BTreeInsertUpdateDeleteOperatorDescriptor(spec, ordersSplitProvider, ordersDesc, bufferCacheProvider, btreeRegistryProvider, fileIdB, "/tmp/btreetestB.ix", interiorFrameFactory, leafFrameFactory, secondaryFieldAccessorFactories, secondaryComparatorFactories, keyFieldsB, payloadFieldsB, BTreeOp.BTO_INSERT);
+        PartitionConstraint insertPartitionConstraintB = new ExplicitPartitionConstraint(new LocationConstraint[] { new AbsoluteLocationConstraint(NC1_ID) });
+        insertOpB.setPartitionConstraint(insertPartitionConstraintB);
+		
+        // second secondary index
+        int[] keyFieldsC = { 4, 0 };
+        int[] payloadFieldsC = { };                
+        BTreeInsertUpdateDeleteOperatorDescriptor insertOpC = new BTreeInsertUpdateDeleteOperatorDescriptor(spec, ordersSplitProvider, ordersDesc, bufferCacheProvider, btreeRegistryProvider, fileIdC, "/tmp/btreetestC.ix", interiorFrameFactory, leafFrameFactory, secondaryFieldAccessorFactories, secondaryComparatorFactories, keyFieldsC, payloadFieldsC, BTreeOp.BTO_INSERT);
+        PartitionConstraint insertPartitionConstraintC = new ExplicitPartitionConstraint(new LocationConstraint[] { new AbsoluteLocationConstraint(NC1_ID) });
+        insertOpC.setPartitionConstraint(insertPartitionConstraintC);
+                
+        NullSinkOperatorDescriptor nullSink = new NullSinkOperatorDescriptor(spec);
+        PartitionConstraint nullSinkPartitionConstraint = new ExplicitPartitionConstraint(new LocationConstraint[] { new AbsoluteLocationConstraint(NC1_ID) });
+        nullSink.setPartitionConstraint(nullSinkPartitionConstraint);
+        
+        spec.connect(new OneToOneConnectorDescriptor(spec), ordScanner, 0, insertOpA, 0);
+        
+        spec.connect(new OneToOneConnectorDescriptor(spec), insertOpA, 0, insertOpB, 0);
+        
+        spec.connect(new OneToOneConnectorDescriptor(spec), insertOpB, 0, insertOpC, 0);        
+        
+        spec.connect(new OneToOneConnectorDescriptor(spec), insertOpC, 0, nullSink, 0);               
+        
+        spec.addRoot(nullSink);
+        runTest(spec);               
+        
+        // scan primary index         
+        System.out.println("PRINTING PRIMARY INDEX");
+        IBTreeCursor scanCursorA = new RangeSearchCursor(leafFrameFactory.getFrame());
+        RangePredicate nullPredA = new RangePredicate(true, null, null, null);
+        btreeA.search(scanCursorA, nullPredA, leafFrameFactory.getFrame(), interiorFrameFactory.getFrame());
+        try {
+        	while (scanCursorA.hasNext()) {
+        		scanCursorA.next();
+        		IFieldIterator fieldIter = scanCursorA.getFieldIterator();                                
+                String rec = primaryCmp.printRecord(fieldIter);
+                System.out.println(rec);
+        	}
+        } catch (Exception e) {
+        	e.printStackTrace();
+        } finally {
+        	scanCursorA.close();
+        }            
+        System.out.println();
+        
+        // scan first secondary index
+        System.out.println("PRINTING FIRST SECONDARY INDEX");
+        IBTreeCursor scanCursorB = new RangeSearchCursor(leafFrameFactory.getFrame());
+        RangePredicate nullPredB = new RangePredicate(true, null, null, null);
+        btreeB.search(scanCursorB, nullPredB, leafFrameFactory.getFrame(), interiorFrameFactory.getFrame());
+        try {
+        	while (scanCursorB.hasNext()) {
+        		scanCursorB.next();
+        		IFieldIterator fieldIter = scanCursorB.getFieldIterator();                                
+                String rec = secondaryCmp.printRecord(fieldIter);
+                System.out.println(rec);
+        	}
+        } catch (Exception e) {
+        	e.printStackTrace();
+        } finally {
+        	scanCursorB.close();
+        }           
+        System.out.println();
+        
+        // scan second secondary index
+        System.out.println("PRINTING SECOND SECONDARY INDEX");
+        IBTreeCursor scanCursorC = new RangeSearchCursor(leafFrameFactory.getFrame());
+        RangePredicate nullPredC = new RangePredicate(true, null, null, null);
+        btreeC.search(scanCursorC, nullPredC, leafFrameFactory.getFrame(), interiorFrameFactory.getFrame());
+        try {
+        	while (scanCursorC.hasNext()) {
+        		scanCursorC.next();
+        		IFieldIterator fieldIter = scanCursorC.getFieldIterator();                                
+                String rec = secondaryCmp.printRecord(fieldIter);
+                System.out.println(rec);
+        	}
+        } catch (Exception e) {
+        	e.printStackTrace();
+        } finally {
+        	scanCursorC.close();
+        }        
+        System.out.println();
+	}
 }
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IBTreeCursor.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IBTreeCursor.java
index 78767d1..74e6478 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IBTreeCursor.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IBTreeCursor.java
@@ -21,11 +21,11 @@
 public interface IBTreeCursor {
 	public void reset();
 	public boolean hasNext() throws Exception;
-	public int getOffset();
 	public void next() throws Exception;	
 	public void open(ICachedPage page, ISearchPredicate searchPred) throws Exception;
 	public ICachedPage getPage();
 	public void close() throws Exception;
 	public void setBufferCache(IBufferCache bufferCache);
 	public void setFileId(int fileId);
+	public IFieldIterator getFieldIterator();
 }
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IBTreeFrame.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IBTreeFrame.java
index da5a39a..aabd005 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IBTreeFrame.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IBTreeFrame.java
@@ -68,12 +68,15 @@
 	public boolean getSmFlag(); // structure modification flag
 	public void setSmFlag(boolean smFlag);	
 	
-	//public int getNumPrefixRecords();
-	//public void setNumPrefixRecords(int numPrefixRecords);
-	
 	public void insertSorted(byte[] data, MultiComparator cmp) throws Exception;
 	
+	public int getSlotSize();
+	
+	public IFieldIterator createFieldIterator();
+	
 	// for debugging
 	public int getFreeSpaceOff();
 	public void setFreeSpaceOff(int freeSpace);
+	
+	
 }
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IFieldIterator.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IFieldIterator.java
new file mode 100644
index 0000000..65702b2
--- /dev/null
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IFieldIterator.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.hyracks.storage.am.btree.api;
+
+import java.nio.ByteBuffer;
+
+public interface IFieldIterator {
+	public void setFrame(IBTreeFrame frame);
+
+    public void setFields(IFieldAccessor[] fields);
+    
+    public void openRecSlotNum(int recSlotNum);
+    
+    public void openRecSlotOff(int recSlotOff);
+    
+    public void reset();
+    
+    public void nextField();
+    
+    public int getFieldOff();
+    
+    public int getFieldSize();
+    
+    public int copyFields(int startField, int endField, byte[] dest, int destOff);   
+    
+    public ByteBuffer getBuffer();
+}
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IPrefixSlotManager.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IPrefixSlotManager.java
index 3599933..7792fa0 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IPrefixSlotManager.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/api/IPrefixSlotManager.java
@@ -15,8 +15,6 @@
 
 package edu.uci.ics.hyracks.storage.am.btree.api;
 
-import java.nio.ByteBuffer;
-
 import edu.uci.ics.hyracks.storage.am.btree.frames.FieldPrefixNSMLeafFrame;
 import edu.uci.ics.hyracks.storage.am.btree.impls.MultiComparator;
 
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/compressors/FieldPrefixCompressor.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/compressors/FieldPrefixCompressor.java
index 27a8952..a0f0258 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/compressors/FieldPrefixCompressor.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/compressors/FieldPrefixCompressor.java
@@ -25,7 +25,7 @@
 import edu.uci.ics.hyracks.storage.am.btree.api.IFrameCompressor;
 import edu.uci.ics.hyracks.storage.am.btree.api.IPrefixSlotManager;
 import edu.uci.ics.hyracks.storage.am.btree.frames.FieldPrefixNSMLeafFrame;
-import edu.uci.ics.hyracks.storage.am.btree.impls.FieldIterator;
+import edu.uci.ics.hyracks.storage.am.btree.impls.FieldPrefixFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.impls.FieldPrefixSlotManager;
 import edu.uci.ics.hyracks.storage.am.btree.impls.MultiComparator;
 
@@ -48,13 +48,13 @@
     	if(numRecords <= 0) {
             frame.setNumPrefixRecords(0);
             frame.setFreeSpaceOff(frame.getOrigFreeSpaceOff());
-            frame.setTotalFreeSpace(frame.getOrigTotalFreeSpace());
+            frame.setTotalFreeSpace(frame.getOrigTotalFreeSpace());            
             return false;
         }
-    	
+    	    	
     	int numUncompressedRecords = frame.getNumUncompressedRecords();
     	float ratio = (float)numUncompressedRecords / (float)numRecords;    	
-    	if(ratio < ratioThreshold) return false;
+    	if(ratio < ratioThreshold) return false;    	
     	
         IBinaryComparator[] cmps = cmp.getComparators();
         IFieldAccessor[] fields = cmp.getFields();
@@ -65,7 +65,7 @@
                 
         // perform analysis pass
         ArrayList<KeyPartition> keyPartitions = getKeyPartitions(frame, cmp, occurrenceThreshold);
-        if(keyPartitions.size() == 0) return false;
+        if(keyPartitions.size() == 0) return false;        
         
         // for each keyPartition, determine the best prefix length for compression, and count how many prefix records we would need in total
         int totalSlotsNeeded = 0;
@@ -143,7 +143,7 @@
         int recSlotNum = 0;
         int prefixSlotNum = 0;
         numUncompressedRecords = 0;
-        FieldIterator recToWrite = new FieldIterator(fields, frame);
+        FieldPrefixFieldIterator recToWrite = new FieldPrefixFieldIterator(fields, frame);
         while(recSlotNum < numRecords) {           
             if(kpIndex < keyPartitions.size()) {
             	
@@ -157,8 +157,8 @@
             		
             		//System.out.println("PROCESSING KEYPARTITION: " + kpIndex + " RANGE: " + keyPartitions.get(kpIndex).firstRecSlotNum + " " + keyPartitions.get(kpIndex).lastRecSlotNum + " FIELDSTOCOMPRESS: " + numFieldsToCompress);
             		
-            		FieldIterator prevRec = new FieldIterator(fields, frame);        
-                    FieldIterator rec = new FieldIterator(fields, frame);
+            		FieldPrefixFieldIterator prevRec = new FieldPrefixFieldIterator(fields, frame);        
+                    FieldPrefixFieldIterator rec = new FieldPrefixFieldIterator(fields, frame);
                     
                     for(int i = recSlotNum + 1; i <= keyPartitions.get(kpIndex).lastRecSlotNum; i++) {
                     	prevRec.openRecSlotNum(i - 1);
@@ -312,8 +312,8 @@
         KeyPartition kp = new KeyPartition(maxCmps);        
         keyPartitions.add(kp);
         
-        FieldIterator prevRec = new FieldIterator(fields, frame);        
-        FieldIterator rec = new FieldIterator(fields, frame);
+        FieldPrefixFieldIterator prevRec = new FieldPrefixFieldIterator(fields, frame);        
+        FieldPrefixFieldIterator rec = new FieldPrefixFieldIterator(fields, frame);
         
         kp.firstRecSlotNum = 0;        
         int numRecords = frame.getNumRecords();
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/AbstractBTreeOperatorDescriptor.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/AbstractBTreeOperatorDescriptor.java
index 0a1efa5..d1ade0c 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/AbstractBTreeOperatorDescriptor.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/AbstractBTreeOperatorDescriptor.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/AbstractBTreeOperatorNodePushable.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/AbstractBTreeOperatorNodePushable.java
index af7c3c6..1949651 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/AbstractBTreeOperatorNodePushable.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/AbstractBTreeOperatorNodePushable.java
@@ -1,8 +1,22 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import java.io.DataOutputStream;
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.RandomAccessFile;
 import java.util.Random;
 
@@ -32,18 +46,25 @@
 	protected AbstractBTreeOperatorDescriptor opDesc;	
 	protected IHyracksContext ctx;
 	
-	public AbstractBTreeOperatorNodePushable(AbstractBTreeOperatorDescriptor opDesc, final IHyracksContext ctx) {
+	protected boolean createBTree;
+	
+	public AbstractBTreeOperatorNodePushable(AbstractBTreeOperatorDescriptor opDesc, final IHyracksContext ctx, boolean createBTree) {
 		this.opDesc = opDesc;
 		this.ctx = ctx;
+		this.createBTree = createBTree;
 	}
 	
-	public void init() throws FileNotFoundException {				
+	public void init() throws Exception {				
 		IBufferCache bufferCache = opDesc.getBufferCacheProvider().getBufferCache();
 		FileManager fileManager = opDesc.getBufferCacheProvider().getFileManager();
 		
         File f = new File(opDesc.getBtreeFileName());
         RandomAccessFile raf = new RandomAccessFile(f, "rw");
         
+        if(!f.exists() && !createBTree) {
+        	throw new Exception("Trying to open btree from file " + opDesc.getBtreeFileName() + " but file doesn't exist.");
+        }
+        
         try {
         	FileInfo fi = new FileInfo(opDesc.getBtreeFileId(), raf);
         	fileManager.registerFile(fi);
@@ -51,6 +72,9 @@
         catch (Exception e) {
         }
         
+        interiorFrame = opDesc.getInteriorFactory().getFrame();
+        leafFrame = opDesc.getLeafFactory().getFrame();    	
+        
 		BTreeRegistry btreeRegistry = opDesc.getBtreeRegistryProvider().getBTreeRegistry();
 		btree = btreeRegistry.get(opDesc.getBtreeFileId());
         if(btree == null) {
@@ -77,23 +101,24 @@
                     MultiComparator cmp = new MultiComparator(comparators, fields);
                 	
                 	btree = new BTree(bufferCache, opDesc.getInteriorFactory(), opDesc.getLeafFactory(), cmp);
-                    btree.open(opDesc.getBtreeFileId());
+                	if(createBTree) {
+                		MetaDataFrame metaFrame = new MetaDataFrame();                		
+                		btree.create(opDesc.getBtreeFileId(), leafFrame, metaFrame);
+                	}
+                	btree.open(opDesc.getBtreeFileId());
                     btreeRegistry.register(opDesc.getBtreeFileId(), btree);
                 }                
             }
             finally {                        
                 btreeRegistry.unlock();
             }
-        }            
-                
-        interiorFrame = opDesc.getInteriorFactory().getFrame();
-        leafFrame = opDesc.getLeafFactory().getFrame();    	
+        }                      
 	}	
 	
 	// debug
 	protected void fill() throws Exception {
-		MetaDataFrame metaFrame = new MetaDataFrame();
 		
+		MetaDataFrame metaFrame = new MetaDataFrame();                		
 		btree.create(opDesc.getBtreeFileId(), leafFrame, metaFrame);
 		
 		Random rnd = new Random();
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeBulkLoadOperatorDescriptor.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeBulkLoadOperatorDescriptor.java
index 221adab..0df2581 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeBulkLoadOperatorDescriptor.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeBulkLoadOperatorDescriptor.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import edu.uci.ics.hyracks.api.context.IHyracksContext;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeBulkLoadOperatorNodePushable.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeBulkLoadOperatorNodePushable.java
index d6b0036..8376260 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeBulkLoadOperatorNodePushable.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeBulkLoadOperatorNodePushable.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import java.nio.ByteBuffer;
@@ -24,7 +39,7 @@
     private IRecordDescriptorProvider recordDescProvider;
     
 	public BTreeBulkLoadOperatorNodePushable(AbstractBTreeOperatorDescriptor opDesc, IHyracksContext ctx, int[] keyFields, int[] payloadFields, float fillFactor, IRecordDescriptorProvider recordDescProvider) {
-		super(opDesc, ctx);
+		super(opDesc, ctx, true);
 		this.keyFields = keyFields;
 		this.payloadFields = payloadFields;
 		this.fillFactor = fillFactor;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeDiskOrderScanOperatorDescriptor.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeDiskOrderScanOperatorDescriptor.java
index 4509d8c..8b1da5a 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeDiskOrderScanOperatorDescriptor.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeDiskOrderScanOperatorDescriptor.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import edu.uci.ics.hyracks.api.context.IHyracksContext;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeDiskOrderScanOperatorNodePushable.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeDiskOrderScanOperatorNodePushable.java
index 74c878a..373a27d 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeDiskOrderScanOperatorNodePushable.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeDiskOrderScanOperatorNodePushable.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import java.io.DataOutput;
@@ -11,6 +26,7 @@
 import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeLeafFrame;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeMetaDataFrame;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.frames.MetaDataFrame;
 import edu.uci.ics.hyracks.storage.am.btree.impls.DiskOrderScanCursor;
 import edu.uci.ics.hyracks.storage.am.btree.impls.MultiComparator;
@@ -18,7 +34,7 @@
 public class BTreeDiskOrderScanOperatorNodePushable extends AbstractBTreeOperatorNodePushable {
 	
 	public BTreeDiskOrderScanOperatorNodePushable(AbstractBTreeOperatorDescriptor opDesc, IHyracksContext ctx) {
-		super(opDesc, ctx);
+		super(opDesc, ctx, false);
 	}
 	
 	@Override
@@ -50,15 +66,13 @@
 				tb.reset();                		
 				cursor.next();
 
-				int recRunner = cursor.getOffset();
-				byte[] array = cursor.getPage().getBuffer().array();
-				for(int i = 0; i < cmp.getFields().length; i++) {
-					int fieldLen = cmp.getFields()[i].getLength(array, recRunner);
-					dos.write(array, recRunner, fieldLen);                			
-					recRunner += fieldLen;
+				IFieldIterator fieldIter = cursor.getFieldIterator();
+				for(int i = 0; i < cmp.getFields().length; i++) {					
+					int fieldLen = fieldIter.getFieldSize();
+					dos.write(fieldIter.getBuffer().array(), fieldIter.getFieldOff(), fieldLen);
 					tb.addFieldEndOffset();
 				}
-
+				
 				if (!appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
 					FrameUtils.flushFrame(frame, writer);
 					appender.reset(frame, true);
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertOperatorNodePushable.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertOperatorNodePushable.java
deleted file mode 100644
index eddbbfa..0000000
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertOperatorNodePushable.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package edu.uci.ics.hyracks.storage.am.btree.dataflow;
-
-import java.nio.ByteBuffer;
-
-import edu.uci.ics.hyracks.api.context.IHyracksContext;
-import edu.uci.ics.hyracks.api.dataflow.value.IRecordDescriptorProvider;
-import edu.uci.ics.hyracks.api.dataflow.value.RecordDescriptor;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAccessor;
-import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeMetaDataFrame;
-import edu.uci.ics.hyracks.storage.am.btree.frames.MetaDataFrame;
-
-public class BTreeInsertOperatorNodePushable extends AbstractBTreeOperatorNodePushable {
-	
-	private final int[] keyFields;
-	private final int[] payloadFields;
-	    
-    private FrameTupleAccessor accessor;
-    
-    private IRecordDescriptorProvider recordDescProvider;
-    
-    private IBTreeMetaDataFrame metaFrame;
-    
-	public BTreeInsertOperatorNodePushable(AbstractBTreeOperatorDescriptor opDesc, IHyracksContext ctx, int[] keyFields, int[] payloadFields, IRecordDescriptorProvider recordDescProvider) {
-		super(opDesc, ctx);
-		this.keyFields = keyFields;
-		this.payloadFields = payloadFields;
-		this.recordDescProvider = recordDescProvider;
-	}
-	
-	@Override
-	public void close() throws HyracksDataException {
-		writer.close();		
-	}
-	
-	@Override
-	public void nextFrame(ByteBuffer buffer) throws HyracksDataException {		
-		accessor.reset(buffer);
-		
-		int tupleCount = accessor.getTupleCount();
-		for(int i = 0; i < tupleCount; i++) {
-			byte[] btreeRecord = buildBTreeRecordFromHyraxRecord(accessor, i, keyFields, payloadFields);
-			try {
-				btree.insert(btreeRecord, leafFrame, interiorFrame, metaFrame);
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
-		}
-		
-		// pass a copy of the frame to next op
-		FrameUtils.flushFrame(buffer.duplicate(), writer);
-	}
-	
-	@Override
-	public void open() throws HyracksDataException {		
-		RecordDescriptor recDesc = recordDescProvider.getInputRecordDescriptor(opDesc.getOperatorId(), 0);		
-		accessor = new FrameTupleAccessor(ctx, recDesc);		
-		try {
-			init();
-			btree.open(opDesc.getBtreeFileId());
-			metaFrame = new MetaDataFrame();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-    @Override
-    public void flush() throws HyracksDataException {
-    }	
-}
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertOperatorDescriptor.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertUpdateDeleteOperatorDescriptor.java
similarity index 62%
rename from hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertOperatorDescriptor.java
rename to hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertUpdateDeleteOperatorDescriptor.java
index 80066be..e88b633 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertOperatorDescriptor.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertUpdateDeleteOperatorDescriptor.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import edu.uci.ics.hyracks.api.context.IHyracksContext;
@@ -11,27 +26,31 @@
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeInteriorFrameFactory;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeLeafFrameFactory;
 import edu.uci.ics.hyracks.storage.am.btree.api.IFieldAccessorFactory;
+import edu.uci.ics.hyracks.storage.am.btree.impls.BTreeOp;
 
-public class BTreeInsertOperatorDescriptor extends AbstractBTreeOperatorDescriptor {
+public class BTreeInsertUpdateDeleteOperatorDescriptor extends AbstractBTreeOperatorDescriptor {
 	
 	private static final long serialVersionUID = 1L;
 	
 	private final int[] keyFields;
 	private final int[] payloadFields;
 	
-	public BTreeInsertOperatorDescriptor(JobSpecification spec,
+	private BTreeOp op;
+	
+	public BTreeInsertUpdateDeleteOperatorDescriptor(JobSpecification spec,
 			IFileSplitProvider fileSplitProvider, RecordDescriptor recDesc,
 			IBufferCacheProvider bufferCacheProvider,
 			IBTreeRegistryProvider btreeRegistryProvider, int btreeFileId,
 			String btreeFileName, IBTreeInteriorFrameFactory interiorFactory,
 			IBTreeLeafFrameFactory leafFactory, IFieldAccessorFactory[] fieldAccessorFactories, 
 			IBinaryComparatorFactory[] comparatorFactories,			
-			int[] keyFields, int[] payloadFields) {
+			int[] keyFields, int[] payloadFields, BTreeOp op) {
 		super(spec, 1, 1, fileSplitProvider, recDesc, bufferCacheProvider,
 				btreeRegistryProvider, btreeFileId, btreeFileName, interiorFactory,
 				leafFactory, fieldAccessorFactories, comparatorFactories);
 		this.keyFields = keyFields;
 		this.payloadFields = payloadFields;
+		this.op = op;
 	}
 	
 	@Override
@@ -39,7 +58,7 @@
 			IOperatorEnvironment env,
 			IRecordDescriptorProvider recordDescProvider, int partition,
 			int nPartitions) {
-		return new BTreeInsertOperatorNodePushable(this, ctx, keyFields, payloadFields, recordDescProvider);
+		return new BTreeInsertUpdateDeleteOperatorNodePushable(this, ctx, keyFields, payloadFields, recordDescProvider, op);
 	}
 	
 }
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertUpdateDeleteOperatorNodePushable.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertUpdateDeleteOperatorNodePushable.java
new file mode 100644
index 0000000..f578538
--- /dev/null
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeInsertUpdateDeleteOperatorNodePushable.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.hyracks.storage.am.btree.dataflow;
+
+import java.nio.ByteBuffer;
+
+import edu.uci.ics.hyracks.api.context.IHyracksContext;
+import edu.uci.ics.hyracks.api.dataflow.value.IRecordDescriptorProvider;
+import edu.uci.ics.hyracks.api.dataflow.value.RecordDescriptor;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAccessor;
+import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
+import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeMetaDataFrame;
+import edu.uci.ics.hyracks.storage.am.btree.frames.MetaDataFrame;
+import edu.uci.ics.hyracks.storage.am.btree.impls.BTreeOp;
+
+public class BTreeInsertUpdateDeleteOperatorNodePushable extends AbstractBTreeOperatorNodePushable {
+	
+	private final int[] keyFields;
+	private final int[] payloadFields;
+	    
+    private FrameTupleAccessor accessor;
+    
+    private IRecordDescriptorProvider recordDescProvider;
+    
+    private IBTreeMetaDataFrame metaFrame;
+    
+    private BTreeOp op;
+    
+	public BTreeInsertUpdateDeleteOperatorNodePushable(AbstractBTreeOperatorDescriptor opDesc, IHyracksContext ctx, int[] keyFields, int[] payloadFields, IRecordDescriptorProvider recordDescProvider, BTreeOp op) {
+		super(opDesc, ctx, false);
+		this.keyFields = keyFields;
+		this.payloadFields = payloadFields;
+		this.recordDescProvider = recordDescProvider;
+		this.op = op;
+	}
+	
+	@Override
+	public void close() throws HyracksDataException {
+		writer.close();		
+	}
+	
+	@Override
+	public void nextFrame(ByteBuffer buffer) throws HyracksDataException {		
+		accessor.reset(buffer);
+		
+		int tupleCount = accessor.getTupleCount();
+		for(int i = 0; i < tupleCount; i++) {
+			byte[] btreeRecord = buildBTreeRecordFromHyraxRecord(accessor, i, keyFields, payloadFields);
+			try {
+				
+				switch(op) {
+				
+				case BTO_INSERT: {
+					btree.insert(btreeRecord, leafFrame, interiorFrame, metaFrame);				
+				} break;
+				
+				case BTO_DELETE: {
+					btree.delete(btreeRecord, leafFrame, interiorFrame, metaFrame);				
+				} break;
+				
+				default: {
+					throw new HyracksDataException("Unsupported operation " + op + " in BTree InsertUpdateDelete operator");
+				}
+				
+				}
+				
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+		
+		// pass a copy of the frame to next op
+		FrameUtils.flushFrame(buffer.duplicate(), writer);
+	}
+	
+	@Override
+	public void open() throws HyracksDataException {		
+		RecordDescriptor recDesc = recordDescProvider.getInputRecordDescriptor(opDesc.getOperatorId(), 0);		
+		accessor = new FrameTupleAccessor(ctx, recDesc);		
+		try {
+			init();
+			btree.open(opDesc.getBtreeFileId());
+			metaFrame = new MetaDataFrame();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+    @Override
+    public void flush() throws HyracksDataException {
+    }	
+}
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeRegistry.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeRegistry.java
index 4ef4789..7f551d0 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeRegistry.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeRegistry.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import java.util.HashMap;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeRegistryProvider.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeRegistryProvider.java
index c07bd8b..677d4d4 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeRegistryProvider.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeRegistryProvider.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 public class BTreeRegistryProvider implements IBTreeRegistryProvider {
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeSearchOperatorDescriptor.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeSearchOperatorDescriptor.java
index b30c6e2..ce5795b 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeSearchOperatorDescriptor.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeSearchOperatorDescriptor.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import edu.uci.ics.hyracks.api.context.IHyracksContext;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeSearchOperatorNodePushable.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeSearchOperatorNodePushable.java
index e360be2..67a4ff2 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeSearchOperatorNodePushable.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeSearchOperatorNodePushable.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import java.io.DataOutput;
@@ -12,6 +27,7 @@
 import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeCursor;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeLeafFrame;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.impls.MultiComparator;
 import edu.uci.ics.hyracks.storage.am.btree.impls.RangePredicate;
 import edu.uci.ics.hyracks.storage.am.btree.impls.RangeSearchCursor;
@@ -24,7 +40,7 @@
 	private int searchKeyFields;
 	
 	public BTreeSearchOperatorNodePushable(AbstractBTreeOperatorDescriptor opDesc, IHyracksContext ctx, boolean isForward, byte[] lowKey, byte[] highKey, int searchKeyFields) {
-		super(opDesc, ctx);
+		super(opDesc, ctx, false);
 		this.isForward = isForward;
 		this.lowKey = lowKey;
 		this.highKey = highKey;
@@ -68,13 +84,11 @@
 			while(cursor.hasNext()) {
 				tb.reset();                		
 				cursor.next();
-
-				int recRunner = cursor.getOffset();
-				byte[] array = cursor.getPage().getBuffer().array();
-				for(int i = 0; i < cmp.getFields().length; i++) {
-					int fieldLen = cmp.getFields()[i].getLength(array, recRunner);
-					dos.write(array, recRunner, fieldLen);                			
-					recRunner += fieldLen;
+				
+				IFieldIterator fieldIter = cursor.getFieldIterator();
+				for(int i = 0; i < cmp.getFields().length; i++) {					
+					int fieldLen = fieldIter.getFieldSize();
+					dos.write(fieldIter.getBuffer().array(), fieldIter.getFieldOff(), fieldLen);
 					tb.addFieldEndOffset();
 				}
 
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BufferCacheProvider.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BufferCacheProvider.java
index 66f062e..bc64d81 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BufferCacheProvider.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BufferCacheProvider.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import java.nio.ByteBuffer;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBTreeOperatorDescriptor.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBTreeOperatorDescriptor.java
index b25aec2..707d20e 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBTreeOperatorDescriptor.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBTreeOperatorDescriptor.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeInteriorFrameFactory;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBTreeRegistryProvider.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBTreeRegistryProvider.java
index ec9a007..128af09 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBTreeRegistryProvider.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBTreeRegistryProvider.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import java.io.Serializable;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBufferCacheProvider.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBufferCacheProvider.java
index 6f0edc6..c1a0eb4 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBufferCacheProvider.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/IBufferCacheProvider.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.dataflow;
 
 import java.io.Serializable;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/FieldPrefixNSMLeafFrame.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/FieldPrefixNSMLeafFrame.java
index 7627055..96884e4 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/FieldPrefixNSMLeafFrame.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/FieldPrefixNSMLeafFrame.java
@@ -23,12 +23,13 @@
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeFrame;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeLeafFrame;
 import edu.uci.ics.hyracks.storage.am.btree.api.IFieldAccessor;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.api.IFrameCompressor;
 import edu.uci.ics.hyracks.storage.am.btree.api.IPrefixSlotManager;
 import edu.uci.ics.hyracks.storage.am.btree.api.ISlotManager;
 import edu.uci.ics.hyracks.storage.am.btree.compressors.FieldPrefixCompressor;
 import edu.uci.ics.hyracks.storage.am.btree.impls.BTreeException;
-import edu.uci.ics.hyracks.storage.am.btree.impls.FieldIterator;
+import edu.uci.ics.hyracks.storage.am.btree.impls.FieldPrefixFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.impls.FieldPrefixSlotManager;
 import edu.uci.ics.hyracks.storage.am.btree.impls.MultiComparator;
 import edu.uci.ics.hyracks.storage.am.btree.impls.SlotOffRecOff;
@@ -164,7 +165,7 @@
             if(exactDelete) {                    
                 IBinaryComparator[] cmps = cmp.getComparators();
                 IFieldAccessor[] fields = cmp.getFields();
-                FieldIterator fieldIter = new FieldIterator(fields, this);                    
+                FieldPrefixFieldIterator fieldIter = new FieldPrefixFieldIterator(fields, this);                    
                 fieldIter.openRecSlotOff(recSlotOff);
                 
                 int dataRunner = 0;
@@ -190,10 +191,11 @@
             // maintain space information, get size of record suffix (suffix could be entire record)
             int recSize = 0;                        
             int suffixFieldStart = 0;
-            FieldIterator fieldIter = new FieldIterator(cmp.getFields(), this);                 
+            FieldPrefixFieldIterator fieldIter = new FieldPrefixFieldIterator(cmp.getFields(), this);                 
             fieldIter.openRecSlotOff(recSlotOff);
             if(prefixSlotNum == FieldPrefixSlotManager.RECORD_UNCOMPRESSED) {
                 suffixFieldStart = 0;
+                buf.putInt(numUncompressedRecordsOff, buf.getInt(numUncompressedRecordsOff) - 1);
             }
             else {                
                 int prefixSlot = buf.getInt(slotManager.getPrefixSlotOff(prefixSlotNum));
@@ -355,13 +357,13 @@
     }
     
     public ISlotManager getSlotManager() {
-        return null; // TODO: dummy
+        return null;
     }
     
     @Override
     public String printKeys(MultiComparator cmp) {      
         StringBuilder strBuilder = new StringBuilder();
-        FieldIterator rec = new FieldIterator(cmp.getFields(), this);      
+        FieldPrefixFieldIterator rec = new FieldPrefixFieldIterator(cmp.getFields(), this);      
         int numRecords = buf.getInt(numRecordsOff);
         for(int i = 0; i < numRecords; i++) {                               	
         	rec.openRecSlotNum(i);        	
@@ -378,7 +380,9 @@
     
     @Override
     public int getRecordOffset(int slotNum) {        
-    	return slotManager.getRecSlotOff(slotNum);
+    	int recSlotOff = slotManager.getRecSlotOff(slotNum);
+    	int recSlot = buf.getInt(recSlotOff);
+    	return slotManager.decodeSecondSlotField(recSlot);    	
     }
     
     @Override
@@ -433,9 +437,40 @@
 	}
 
     @Override
-    public void insertSorted(byte[] data, MultiComparator cmp) throws Exception {
-        // TODO Auto-generated method stub
-        
+    public void insertSorted(byte[] data, MultiComparator cmp) throws Exception {    	
+    	int freeSpace = buf.getInt(freeSpaceOff);				
+		int fieldsToTruncate = 0;
+		if(buf.getInt(numPrefixRecordsOff) > 0) {
+			// check if record matches last prefix record
+			int prefixSlotOff = slotManager.getPrefixSlotOff(buf.getInt(numPrefixRecordsOff)-1);
+			int prefixSlot = buf.getInt(prefixSlotOff);
+			int numPrefixFields = slotManager.decodeFirstSlotField(prefixSlot);
+			int prefixRecOff = slotManager.decodeSecondSlotField(prefixSlot);
+			
+			if(cmp.fieldRangeCompare(data, 0, buf.array(), prefixRecOff, 0, numPrefixFields) == 0) {
+				fieldsToTruncate = numPrefixFields;													
+			}			
+		}
+				
+		// copy truncated record
+		int recStart = 0;		
+		for(int i = 0; i < fieldsToTruncate; i++) {
+			recStart += cmp.getFields()[i].getLength(data, recStart);
+		}
+		int recLen = data.length - recStart;
+		System.arraycopy(data, recStart, buf.array(), freeSpace, recLen);
+		
+		// insert slot
+		int prefixSlotNum = FieldPrefixSlotManager.RECORD_UNCOMPRESSED;
+		if(fieldsToTruncate > 0) prefixSlotNum = buf.getInt(numPrefixRecordsOff)-1;					
+		else buf.putInt(numUncompressedRecordsOff, buf.getInt(numUncompressedRecordsOff) + 1);					
+		int insSlot = slotManager.encodeSlotFields(prefixSlotNum, FieldPrefixSlotManager.GREATEST_SLOT);				
+		slotManager.insertSlot(insSlot, freeSpace);
+		
+		// update page metadata
+		buf.putInt(numRecordsOff, buf.getInt(numRecordsOff) + 1);
+		buf.putInt(freeSpaceOff, buf.getInt(freeSpaceOff) + recLen);
+		buf.putInt(totalFreeSpaceOff, buf.getInt(totalFreeSpaceOff) - recLen - slotManager.getSlotSize());			
     }
     
     @Override
@@ -579,7 +614,7 @@
 		int splitKeyRecSlotOff = slotManager.getRecSlotEndOff();		
 		
 		int keySize = 0;
-		FieldIterator fieldIter = new FieldIterator(cmp.getFields(), this);
+		FieldPrefixFieldIterator fieldIter = new FieldPrefixFieldIterator(cmp.getFields(), this);
 		fieldIter.openRecSlotOff(splitKeyRecSlotOff);		
 		for(int i = 0; i < cmp.getKeyLength(); i++) {
 			keySize += fieldIter.getFieldSize();
@@ -632,4 +667,14 @@
 	public void setNumUncompressedRecords(int numUncompressedRecords) {
 		buf.putInt(numUncompressedRecordsOff, numUncompressedRecords);
 	}
+	
+	@Override
+	public int getSlotSize() {
+		return slotManager.getSlotSize();
+	}
+	
+	@Override
+    public IFieldIterator createFieldIterator() {
+    	return new FieldPrefixFieldIterator();
+    }
 }
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMFrame.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMFrame.java
index 20a3e19..cca5268 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMFrame.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMFrame.java
@@ -20,9 +20,11 @@
 import java.util.Collections;
 
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeFrame;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.api.ISlotManager;
 import edu.uci.ics.hyracks.storage.am.btree.impls.BTreeException;
 import edu.uci.ics.hyracks.storage.am.btree.impls.MultiComparator;
+import edu.uci.ics.hyracks.storage.am.btree.impls.NSMFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.impls.OrderedSlotManager;
 import edu.uci.ics.hyracks.storage.am.btree.impls.SlotOffRecOff;
 import edu.uci.ics.hyracks.storage.am.btree.impls.SpaceStatus;
@@ -263,4 +265,14 @@
     public boolean compress(MultiComparator cmp) {
         return false;
     }
+    
+    @Override
+    public int getSlotSize() {
+    	return slotManager.getSlotSize();
+    }
+    
+    @Override
+    public IFieldIterator createFieldIterator() {
+    	return new NSMFieldIterator();
+    }
 }
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMInteriorFrame.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMInteriorFrame.java
index 773400a..a3af5b2 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMInteriorFrame.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMInteriorFrame.java
@@ -103,7 +103,7 @@
 		buf.putInt(numRecordsOff, buf.getInt(numRecordsOff) + 1);
 		buf.putInt(freeSpaceOff, buf.getInt(freeSpaceOff) + recSize);
 		buf.putInt(totalFreeSpaceOff, buf.getInt(totalFreeSpaceOff) - recSize - slotManager.getSlotSize());
-		System.arraycopy(data, recSize, buf.array(), rightLeafOff, childPtrSize);			
+		System.arraycopy(data, recSize, buf.array(), rightLeafOff, childPtrSize);
 	}
 		
 	@Override
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMInteriorFrameFactory.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMInteriorFrameFactory.java
index f772761..81a6e34 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMInteriorFrameFactory.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMInteriorFrameFactory.java
@@ -19,6 +19,9 @@
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeInteriorFrameFactory;
 
 public class NSMInteriorFrameFactory implements IBTreeInteriorFrameFactory {
+	
+	private static final long serialVersionUID = 1L;
+
 	@Override
 	public IBTreeInteriorFrame getFrame() {		
 		return new NSMInteriorFrame();
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMLeafFrame.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMLeafFrame.java
index 3d51f05c..c41106d 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMLeafFrame.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMLeafFrame.java
@@ -90,7 +90,7 @@
 		buf.putInt(freeSpaceOff, buf.getInt(freeSpaceOff) + data.length);
 		buf.putInt(totalFreeSpaceOff, buf.getInt(totalFreeSpaceOff) - data.length - slotManager.getSlotSize());
 	}
-
+	
 	@Override
 	public int split(IBTreeFrame rightFrame, byte[] data, MultiComparator cmp, SplitKey splitKey) throws Exception {
 		
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMLeafFrameFactory.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMLeafFrameFactory.java
index 7ef1c8f..169327b 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMLeafFrameFactory.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/NSMLeafFrameFactory.java
@@ -19,6 +19,9 @@
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeLeafFrameFactory;
 
 public class NSMLeafFrameFactory implements IBTreeLeafFrameFactory {
+			
+	private static final long serialVersionUID = 1L;
+
 	@Override
 	public IBTreeLeafFrame getFrame() {		
 		return new NSMLeafFrame();
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTree.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTree.java
index 74e67af..42d375c 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTree.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTree.java
@@ -20,6 +20,7 @@
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeCursor;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeFrame;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeInteriorFrame;
@@ -33,7 +34,7 @@
 import edu.uci.ics.hyracks.storage.common.file.FileInfo;
 
 public class BTree {
-		
+	
     private final static int RESTART_OP = Integer.MIN_VALUE;
     private final static int MAX_RESTARTS = 10;
     
@@ -42,13 +43,14 @@
     private final int rootPage = 1; // the root page never changes
     
     private boolean created = false;
-    
+            
     private final IBufferCache bufferCache;
     private int fileId;
     private final IBTreeInteriorFrameFactory interiorFrameFactory;
     private final IBTreeLeafFrameFactory leafFrameFactory;    
     private final MultiComparator cmp;
-    private final ReadWriteLock treeLatch;
+    private final ReadWriteLock treeLatch;    
+    private final RangePredicate diskOrderScanPredicate;
     
     public int rootSplits = 0;
     public int[] splitsByLevel = new int[500];
@@ -93,6 +95,7 @@
         this.leafFrameFactory = leafFrameFactory;       
         this.cmp = cmp;
         this.treeLatch = new ReentrantReadWriteLock(true);
+        this.diskOrderScanPredicate = new RangePredicate(true, null, null, cmp);
     }
     
     public void create(int fileId, IBTreeLeafFrame leafFrame, IBTreeMetaDataFrame metaFrame) throws Exception {
@@ -102,7 +105,7 @@
     	treeLatch.writeLock().lock();	
     	try {
     	
-    		// check if another thread bet us to it
+    		// check if another thread beat us to it
     		if(created) return;    		    		
     		
     		// initialize meta data page
@@ -285,6 +288,26 @@
         }
     }
     
+    public int getMaxPage(IBTreeMetaDataFrame metaFrame) throws HyracksDataException {
+    	ICachedPage metaNode = bufferCache.pin(FileInfo.getDiskPageId(fileId, metaDataPage), false);
+		pins++;
+		
+		metaNode.acquireWriteLatch();
+		writeLatchesAcquired++;
+		int maxPage = -1;
+		try {
+			metaFrame.setPage(metaNode);			
+			maxPage = metaFrame.getMaxPage();
+		} finally {
+			metaNode.releaseWriteLatch();
+			writeLatchesReleased++;
+			bufferCache.unpin(metaNode);
+			unpins++;
+		}
+		
+		return maxPage;
+    }
+    
     public void printTree(IBTreeLeafFrame leafFrame, IBTreeInteriorFrame interiorFrame) throws Exception {
         printTree(rootPage, null, false, leafFrame, interiorFrame);
     }
@@ -393,7 +416,7 @@
         cursor.setFileId(fileId);
         cursor.setCurrentPageId(currentPageId);
         cursor.setMaxPageId(maxPageId);
-        cursor.open(page, null);
+        cursor.open(page, diskOrderScanPredicate);
     }
     
     public void search(IBTreeCursor cursor, RangePredicate pred, IBTreeLeafFrame leafFrame,
@@ -1179,13 +1202,13 @@
 
             interiorFrame.setPage(leafFrontier.page);
             interiorFrame.initBuffer((byte) 0);
-            interiorMaxBytes = (int) ((float) interiorFrame.getTotalFreeSpace() * fillFactor);
-
+            interiorMaxBytes = (int) ((float) interiorFrame.getBuffer().capacity() * fillFactor);
+            
             leafFrame.setPage(leafFrontier.page);
             leafFrame.initBuffer((byte) 0);
-            leafMaxBytes = (int) ((float) leafFrame.getTotalFreeSpace() * fillFactor);
-
-            slotSize = leafFrame.getSlotManager().getSlotSize();
+            leafMaxBytes = (int) ((float) leafFrame.getBuffer().capacity() * fillFactor);
+            
+            slotSize = leafFrame.getSlotSize();
 
             this.leafFrame = leafFrame;
             this.interiorFrame = interiorFrame;
@@ -1196,7 +1219,6 @@
 
         private void addLevel() throws Exception {
             NodeFrontier frontier = new NodeFrontier();
-            frontier.bytesInserted = 0;
             frontier.pageId = getFreePage(metaFrame);
             frontier.page = bufferCache.pin(FileInfo.getDiskPageId(fileId, frontier.pageId), bulkNewPage);
             frontier.page.acquireWriteLatch();
@@ -1218,10 +1240,9 @@
         ctx.interiorFrame.setPage(frontier.page);
         byte[] insBytes = ctx.splitKey.getData();
         int keySize = cmp.getKeySize(insBytes, 0);
-        int spaceNeeded = keySize + ctx.slotSize + 4; // TODO: this is a dirty
-        // constant for the size
-        // of a child pointer
-        if (frontier.bytesInserted + spaceNeeded > ctx.interiorMaxBytes) {
+        int spaceNeeded = keySize + ctx.slotSize + 4; // TODO: this is a dirty constant for the size of a child pointer
+        int spaceUsed = ctx.interiorFrame.getBuffer().capacity() - ctx.interiorFrame.getTotalFreeSpace();
+        if (spaceUsed + spaceNeeded > ctx.interiorMaxBytes) {
             ctx.interiorFrame.deleteGreatest(cmp);
             int splitKeySize = cmp.getKeySize(frontier.lastRecord, 0);
             ctx.splitKey.initData(splitKeySize);
@@ -1239,11 +1260,9 @@
             frontier.page.acquireWriteLatch();
             ctx.interiorFrame.setPage(frontier.page);
             ctx.interiorFrame.initBuffer((byte) level);
-            frontier.bytesInserted = 0;
         }
         ctx.interiorFrame.insertSorted(insBytes, cmp);
         frontier.lastRecord = insBytes;
-        frontier.bytesInserted += spaceNeeded;
     }
     
     // assumes btree has been created and opened
@@ -1257,7 +1276,15 @@
         IBTreeLeafFrame leafFrame = ctx.leafFrame;
         
         int spaceNeeded = record.length + ctx.slotSize;
-        if (leafFrontier.bytesInserted + spaceNeeded > ctx.leafMaxBytes) {
+        int spaceUsed = leafFrame.getBuffer().capacity() - leafFrame.getTotalFreeSpace();
+        
+        // try to free space by compression
+        if (spaceUsed + spaceNeeded > ctx.leafMaxBytes) {
+        	leafFrame.compress(cmp);
+        	spaceUsed = leafFrame.getBuffer().capacity() - leafFrame.getTotalFreeSpace();
+        }
+        
+        if (spaceUsed + spaceNeeded > ctx.leafMaxBytes) {
             int splitKeySize = cmp.getKeySize(leafFrontier.lastRecord, 0);
             ctx.splitKey.initData(splitKeySize);            
             System.arraycopy(leafFrontier.lastRecord, 0, ctx.splitKey.getData(), 0, splitKeySize);
@@ -1276,13 +1303,11 @@
             leafFrame.setPage(leafFrontier.page);
             leafFrame.initBuffer((byte) 0);
             leafFrame.setPrevLeaf(prevPageId);
-            leafFrontier.bytesInserted = 0;
         }
         
         leafFrame.setPage(leafFrontier.page);
         leafFrame.insertSorted(record, cmp);
         leafFrontier.lastRecord = record;
-        leafFrontier.bytesInserted += spaceNeeded;
     }
     
     public void endBulkLoad(BulkLoadContext ctx) throws Exception {                
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTreeOp.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTreeOp.java
index b1909a9..4c0ef81 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTreeOp.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTreeOp.java
@@ -18,5 +18,6 @@
 public enum BTreeOp {
 	BTO_INSERT,
 	BTO_DELETE,
-	BTO_SEARCH	
+	BTO_UPDATE,
+	BTO_SEARCH
 }
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/DiskOrderScanCursor.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/DiskOrderScanCursor.java
index 441ea02..443cf2a 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/DiskOrderScanCursor.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/DiskOrderScanCursor.java
@@ -17,6 +17,7 @@
 
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeCursor;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeLeafFrame;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.api.ISearchPredicate;
 import edu.uci.ics.hyracks.storage.common.buffercache.IBufferCache;
 import edu.uci.ics.hyracks.storage.common.buffercache.ICachedPage;
@@ -27,7 +28,6 @@
     // TODO: might want to return records in physical order, not logical order to speed up access
     
     private int recordNum = 0;
-    private int recordOffset = -1;
     private int fileId = -1;    
     int currentPageId = -1;
     int maxPageId = -1; // TODO: figure out how to scan to the end of file, this is dirty and may not with concurrent updates
@@ -35,8 +35,12 @@
     private IBTreeLeafFrame frame = null;
     private IBufferCache bufferCache = null;
     
+    private IFieldIterator fieldIter;
+    
     public DiskOrderScanCursor(IBTreeLeafFrame frame) {
         this.frame = frame;
+        this.fieldIter = frame.createFieldIterator();
+		this.fieldIter.setFrame(frame);
     }
     
     @Override
@@ -45,12 +49,13 @@
         bufferCache.unpin(page);
         page = null;
     }
-
+    
     @Override
-    public int getOffset() {
-        return recordOffset;
-    }
-
+    public IFieldIterator getFieldIterator() {
+		fieldIter.reset();
+		return fieldIter;
+	}
+    
     @Override
     public ICachedPage getPage() {
         return page;
@@ -80,7 +85,7 @@
         if(recordNum >= frame.getNumRecords()) {
             boolean nextLeafExists = positionToNextLeaf(true);
             if(nextLeafExists) {
-                recordOffset = frame.getRecordOffset(recordNum);
+            	fieldIter.openRecSlotNum(recordNum);
                 return true;
             }
             else {
@@ -88,7 +93,7 @@
             }
         }        
         
-        recordOffset = frame.getRecordOffset(recordNum);
+        fieldIter.openRecSlotNum(recordNum);        
         return true;
     }
 
@@ -108,6 +113,9 @@
         this.page = page;
         recordNum = 0;
         frame.setPage(page);
+        RangePredicate pred = (RangePredicate)searchPred;
+		MultiComparator cmp = pred.getComparator();
+		this.fieldIter.setFields(cmp.getFields());
         boolean leafExists = positionToNextLeaf(false);
         if(!leafExists) {
             throw new Exception("Failed to open disk-order scan cursor for B-tree. Traget B-tree has no leaves.");
@@ -117,7 +125,6 @@
     @Override
     public void reset() {
         recordNum = 0;
-        recordOffset = 0;
         currentPageId = -1;
         maxPageId = -1;
         page = null;     
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/FieldIterator.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/FieldPrefixFieldIterator.java
similarity index 87%
rename from hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/FieldIterator.java
rename to hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/FieldPrefixFieldIterator.java
index 8132199..f0fdf1d 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/FieldIterator.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/FieldPrefixFieldIterator.java
@@ -15,11 +15,15 @@
 
 package edu.uci.ics.hyracks.storage.am.btree.impls;
 
+import java.nio.ByteBuffer;
+
+import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeFrame;
 import edu.uci.ics.hyracks.storage.am.btree.api.IFieldAccessor;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.frames.FieldPrefixNSMLeafFrame;
 
-//TODO: make members private, only for debugging now
-public class FieldIterator {
+// TODO: make members private, only for debugging now
+public class FieldPrefixFieldIterator implements IFieldIterator {
     public int recSlotOff = -1;
     public int recOff = -1;
     public int prefixSlotNum = FieldPrefixSlotManager.RECORD_UNCOMPRESSED;
@@ -30,13 +34,16 @@
     public int currentField = -1;
     public int recOffRunner = -1;
     
-    public FieldIterator(IFieldAccessor[] fields, FieldPrefixNSMLeafFrame frame) {
+    public FieldPrefixFieldIterator() {    	
+    }
+    
+    public FieldPrefixFieldIterator(IFieldAccessor[] fields, FieldPrefixNSMLeafFrame frame) {
         this.fields = fields;
         this.frame = frame;
     }
     
-    public void setFrame(FieldPrefixNSMLeafFrame frame) {
-        this.frame = frame;        
+    public void setFrame(IBTreeFrame frame) {
+        this.frame = (FieldPrefixNSMLeafFrame)frame;        
     }
     
     public void setFields(IFieldAccessor[] fields) {
@@ -121,4 +128,8 @@
         return bytesWritten;
     }
     
+    @Override
+    public ByteBuffer getBuffer() {
+    	return frame.getBuffer();
+    }
 }
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/FieldPrefixSlotManager.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/FieldPrefixSlotManager.java
index de4c913..e6d28bd 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/FieldPrefixSlotManager.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/FieldPrefixSlotManager.java
@@ -30,7 +30,7 @@
 	
 	private ByteBuffer buf;
 	private FieldPrefixNSMLeafFrame frame;
-	FieldIterator fieldIter = new FieldIterator(null, null);
+	FieldPrefixFieldIterator fieldIter = new FieldPrefixFieldIterator(null, null);
 	
 	public int decodeFirstSlotField(int slot) {
 		return (slot & 0xFF000000) >>> 24;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/MultiComparator.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/MultiComparator.java
index 659cfbf..6dbd9c5 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/MultiComparator.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/MultiComparator.java
@@ -17,6 +17,7 @@
 
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.storage.am.btree.api.IFieldAccessor;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldIterator;
 
 public class MultiComparator {
     	
@@ -69,6 +70,24 @@
     	return 0;
 	}
 	
+	public int compare(byte[] data, int recOff, IFieldIterator fieldIter) {
+		 fieldIter.reset();
+         
+         int recRunner = 0;
+         int cmp = 0;
+         for(int i = 0; i < cmps.length; i++) {
+        	 int recFieldLen = fields[i].getLength(data, recRunner);
+        	 cmp = cmps[i].compare(data, recRunner, recFieldLen, fieldIter.getBuffer().array(), fieldIter.getFieldOff(), fieldIter.getFieldSize());          
+             if(cmp < 0) return -1;
+             else if(cmp > 0) return 1;             
+             fieldIter.nextField();
+             recRunner += recFieldLen;
+         }
+         
+         fieldIter.reset();
+         return 0;
+	}
+	
 	public int fieldRangeCompare(byte[] dataA, int recOffA, byte[] dataB, int recOffB, int startFieldIndex, int numFields) {
 		int lenA;
 		int lenB;
@@ -100,6 +119,16 @@
 		return runner - recOff;
 	}		
 	
+	public String printRecord(IFieldIterator fieldIter) {
+		StringBuilder strBuilder = new StringBuilder();	    
+		fieldIter.reset();
+		for(int i = 0; i < fields.length; i++) {
+			strBuilder.append(fields[i].print(fieldIter.getBuffer().array(), fieldIter.getFieldOff()) + " ");						
+			fieldIter.nextField();
+		}
+		return strBuilder.toString();
+	}
+		
 	public String printRecord(byte[] data, int recOff) {
 		StringBuilder strBuilder = new StringBuilder();
 	    int runner = recOff;
@@ -109,7 +138,7 @@
 		}
 		return strBuilder.toString();
 	}
-	
+		
 	public String printKey(byte[] data, int recOff) {
 		StringBuilder strBuilder = new StringBuilder();		
 		int runner = recOff;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/NSMFieldIterator.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/NSMFieldIterator.java
new file mode 100644
index 0000000..760fa8a
--- /dev/null
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/NSMFieldIterator.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.hyracks.storage.am.btree.impls;
+
+import java.nio.ByteBuffer;
+
+import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeFrame;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldAccessor;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldIterator;
+import edu.uci.ics.hyracks.storage.am.btree.frames.NSMFrame;
+
+public class NSMFieldIterator implements IFieldIterator {
+    public int recOff = -1;
+    public IFieldAccessor[] fields;
+    public NSMFrame frame;
+    
+    public int currentField = -1;
+    public int recOffRunner = -1;
+		
+	public NSMFieldIterator() {    	
+    }
+    
+    public NSMFieldIterator(IFieldAccessor[] fields, NSMFrame frame) {
+        this.fields = fields;
+        this.frame = frame;
+    }
+    
+    public void setFrame(NSMFrame frame) {
+        this.frame = frame;        
+    }
+    
+    public void setFields(IFieldAccessor[] fields) {
+        this.fields = fields;
+    }
+    
+    public void openRecSlotNum(int recSlotNum) {                 
+    	int recSlotOff = frame.getSlotManager().getSlotOff(recSlotNum);
+    	openRecSlotOff(recSlotOff);
+    }
+    
+    public void openRecSlotOff(int recSlotOff) {
+    	recOff = frame.getSlotManager().getRecOff(recSlotOff);
+        reset();
+    }
+    
+    // re-position to first field
+    public void reset() {
+        currentField = 0;
+        recOffRunner = recOff;               
+    }
+    
+    public void nextField() {                   
+    	recOffRunner += fields[currentField].getLength(frame.getBuffer().array(), recOffRunner);    
+    }
+    
+    public int getFieldOff() {
+        return recOffRunner;
+    }        
+    
+    public int getFieldSize() {
+        return fields[currentField].getLength(frame.getBuffer().array(), recOffRunner);                
+    }
+    
+    public int copyFields(int startField, int endField, byte[] dest, int destOff) {
+    
+    	return 0;
+    }
+
+	@Override
+	public void setFrame(IBTreeFrame frame) {
+		this.frame = (NSMFrame)frame;
+	}	
+	
+	@Override
+    public ByteBuffer getBuffer() {
+    	return frame.getBuffer();
+    }
+}
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/NodeFrontier.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/NodeFrontier.java
index df5f064..6dcafb4 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/NodeFrontier.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/NodeFrontier.java
@@ -18,7 +18,6 @@
 import edu.uci.ics.hyracks.storage.common.buffercache.ICachedPage;
 
 public class NodeFrontier {
-	public int bytesInserted;
 	public ICachedPage page;
 	public int pageId;
 	public byte[] lastRecord;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/RangePredicate.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/RangePredicate.java
index 68d7ad2..d71019f 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/RangePredicate.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/RangePredicate.java
@@ -25,7 +25,7 @@
 	protected byte[] lowKeys = null;
 	protected byte[] highKeys = null;
 	protected MultiComparator cmp;
-	
+			
 	public RangePredicate() {
 	}
 	
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/RangeSearchCursor.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/RangeSearchCursor.java
index 99784bc..b6234fb 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/RangeSearchCursor.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/RangeSearchCursor.java
@@ -17,6 +17,7 @@
 
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeCursor;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeLeafFrame;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.api.ISearchPredicate;
 import edu.uci.ics.hyracks.storage.common.buffercache.IBufferCache;
 import edu.uci.ics.hyracks.storage.common.buffercache.ICachedPage;
@@ -32,8 +33,12 @@
 	private IBTreeLeafFrame frame = null;
 	private IBufferCache bufferCache = null;
 	
+	private IFieldIterator fieldIter;
+	
 	public RangeSearchCursor(IBTreeLeafFrame frame) {
-		this.frame = frame;		
+		this.frame = frame;
+		this.fieldIter = frame.createFieldIterator();
+		this.fieldIter.setFrame(frame);
 	}
 	
 	@Override
@@ -42,12 +47,12 @@
 		bufferCache.unpin(page);
 		page = null;
 	}
-
-	@Override
-	public int getOffset() {
-		return recordOffset;
+	
+	public IFieldIterator getFieldIterator() {
+		fieldIter.reset();
+		return fieldIter;
 	}
-
+	
 	@Override
 	public ICachedPage getPage() {
 		return page;
@@ -86,10 +91,12 @@
 		MultiComparator cmp = pred.getComparator();
 		if(searchPred.isForward()) {
 			byte[] highKeys = pred.getHighKeys();			
-			recordOffset = frame.getRecordOffset(recordNum);
+			fieldIter.openRecSlotNum(recordNum);
+			//recordOffset = frame.getRecordOffset(recordNum);
 			
-			if(highKeys == null) return true;						
-			if(cmp.compare(highKeys, 0, page.getBuffer().array(), recordOffset) < 0) {
+			if(highKeys == null) return true;									
+			//if(cmp.compare(highKeys, 0, page.getBuffer().array(), recordOffset) < 0) {
+			if(cmp.compare(highKeys, 0, fieldIter) < 0) {
 				return false;
 			}
 			else {
@@ -111,7 +118,7 @@
 	}
 
 	@Override
-	public void next() throws Exception {		
+	public void next() throws Exception {				
 		recordNum++;
 	}
 	
@@ -122,35 +129,40 @@
 			this.page.releaseReadLatch();
 			bufferCache.unpin(this.page);
 		}
-		
+						
 		this.searchPred = searchPred;
 		this.page = page;
-		frame.setPage(page);
+		frame.setPage(page);					
 		
 		// position recordNum to the first appropriate key
 		// TODO: can be done more efficiently with binary search but this needs some thinking/refactoring
 		RangePredicate pred = (RangePredicate)searchPred;
 		MultiComparator cmp = pred.getComparator();
+		this.fieldIter.setFields(cmp.getFields());
 		if(searchPred.isForward()) {
 			byte[] lowKeys = pred.getLowKeys();
 						
-			recordOffset = frame.getRecordOffset(recordNum);
+			//recordOffset = frame.getRecordOffset(recordNum);			
+			fieldIter.openRecSlotNum(recordNum);
 			if(lowKeys == null) return; // null means -infinity
-			
-			while(cmp.compare(lowKeys, 0, page.getBuffer().array(), recordOffset) > 0 && recordNum < frame.getNumRecords()) {				
+						
+			while(cmp.compare(lowKeys, 0, fieldIter) > 0 && recordNum < frame.getNumRecords()) {
+			//while(cmp.compare(lowKeys, 0, page.getBuffer().array(), recordOffset) > 0 && recordNum < frame.getNumRecords()) {
 			    recordNum++;
-			    recordOffset = frame.getRecordOffset(recordNum);
-			}
+			    fieldIter.openRecSlotNum(recordNum);
+			}						
 		}
 		else {
 			byte[] highKeys = pred.getHighKeys();
 						
-			recordOffset = frame.getRecordOffset(frame.getNumRecords() - recordNum - 1);			
+			//recordOffset = frame.getRecordOffset(frame.getNumRecords() - recordNum - 1);
+			fieldIter.openRecSlotNum(recordNum);
 			if(highKeys != null) return; // null means +infinity
 			    
 			while(cmp.compare(highKeys, 0, page.getBuffer().array(), recordOffset) < 0 && recordNum < frame.getNumRecords()) {				
 			    recordNum++;
-			    recordOffset = frame.getRecordOffset(frame.getNumRecords() - recordNum - 1);				
+			    fieldIter.openRecSlotNum(recordNum);
+			    //recordOffset = frame.getRecordOffset(frame.getNumRecords() - recordNum - 1);			
 			}						
 		}
 	}
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/types/Int32AccessorFactory.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/types/Int32AccessorFactory.java
index b8607c0..4eceeb2 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/types/Int32AccessorFactory.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/types/Int32AccessorFactory.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.types;
 
 import edu.uci.ics.hyracks.storage.am.btree.api.IFieldAccessor;
diff --git a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/types/UTF8StringAccessorFactory.java b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/types/UTF8StringAccessorFactory.java
index e2d8053..1359190 100644
--- a/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/types/UTF8StringAccessorFactory.java
+++ b/hyracks/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/types/UTF8StringAccessorFactory.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package edu.uci.ics.hyracks.storage.am.btree.types;
 
 import edu.uci.ics.hyracks.storage.am.btree.api.IFieldAccessor;
diff --git a/hyracks/hyracks-storage-am-btree/src/test/java/edu/uci/ics/hyracks/storage/am/btree/BTreeTest.java b/hyracks/hyracks-storage-am-btree/src/test/java/edu/uci/ics/hyracks/storage/am/btree/BTreeTest.java
index 1fb08e4..3caba23 100644
--- a/hyracks/hyracks-storage-am-btree/src/test/java/edu/uci/ics/hyracks/storage/am/btree/BTreeTest.java
+++ b/hyracks/hyracks-storage-am-btree/src/test/java/edu/uci/ics/hyracks/storage/am/btree/BTreeTest.java
@@ -37,6 +37,7 @@
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeMetaDataFrame;
 import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeMetaDataFrameFactory;
 import edu.uci.ics.hyracks.storage.am.btree.api.IFieldAccessor;
+import edu.uci.ics.hyracks.storage.am.btree.api.IFieldIterator;
 import edu.uci.ics.hyracks.storage.am.btree.frames.MetaDataFrameFactory;
 import edu.uci.ics.hyracks.storage.am.btree.frames.NSMInteriorFrameFactory;
 import edu.uci.ics.hyracks.storage.am.btree.frames.NSMLeafFrameFactory;
@@ -56,6 +57,7 @@
 import edu.uci.ics.hyracks.storage.common.file.FileManager;
 
 public class BTreeTest {    
+	
     private static final int PAGE_SIZE = 128;
     // private static final int PAGE_SIZE = 8192;
     private static final int NUM_PAGES = 10;
@@ -169,9 +171,8 @@
         try {
             while (scanCursor.hasNext()) {
                 scanCursor.next();
-                byte[] array = scanCursor.getPage().getBuffer().array();
-                int recOffset = scanCursor.getOffset();                
-                String rec = cmp.printRecord(array, recOffset);
+                IFieldIterator fieldIter = scanCursor.getFieldIterator();                                
+                String rec = cmp.printRecord(fieldIter);
                 print(rec + "\n");
             }
         } catch (Exception e) {
@@ -187,9 +188,8 @@
         try {
             while (diskOrderCursor.hasNext()) {
                 diskOrderCursor.next();
-                byte[] array = diskOrderCursor.getPage().getBuffer().array();
-                int recOffset = diskOrderCursor.getOffset();                
-                String rec = cmp.printRecord(array, recOffset);
+                IFieldIterator fieldIter = diskOrderCursor.getFieldIterator();                                
+                String rec = cmp.printRecord(fieldIter);
                 print(rec + "\n");
             }
         } catch (Exception e) {
@@ -224,10 +224,9 @@
         try {
             while (rangeCursor.hasNext()) {
                 rangeCursor.next();
-                byte[] array = rangeCursor.getPage().getBuffer().array();
-                int recOffset = rangeCursor.getOffset();                
-                String rec = cmp.printRecord(array, recOffset);
-                print(rec + "\n");         
+                IFieldIterator fieldIter = rangeCursor.getFieldIterator();                                
+                String rec = cmp.printRecord(fieldIter);
+                print(rec + "\n"); 
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -329,10 +328,9 @@
         try {
             while (scanCursor.hasNext()) {
                 scanCursor.next();
-                byte[] array = scanCursor.getPage().getBuffer().array();
-                int recOffset = scanCursor.getOffset();                
-                String rec = cmp.printRecord(array, recOffset);
-                print(rec + "\n");                
+                IFieldIterator fieldIter = scanCursor.getFieldIterator();                                
+                String rec = cmp.printRecord(fieldIter);
+                print(rec + "\n");         
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -365,10 +363,9 @@
         try {
             while (rangeCursor.hasNext()) {
                 rangeCursor.next();
-                byte[] array = rangeCursor.getPage().getBuffer().array();
-                int recOffset = rangeCursor.getOffset();                
-                String rec = cmp.printRecord(array, recOffset);
-                print(rec + "\n");                
+                IFieldIterator fieldIter = rangeCursor.getFieldIterator();                                
+                String rec = cmp.printRecord(fieldIter);
+                print(rec + "\n");         
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -461,10 +458,9 @@
         try {
             while (scanCursor.hasNext()) {
                 scanCursor.next();
-                byte[] array = scanCursor.getPage().getBuffer().array();
-                int recOffset = scanCursor.getOffset();                
-                String rec = cmp.printRecord(array, recOffset);
-                print(rec + "\n");                
+                IFieldIterator fieldIter = scanCursor.getFieldIterator();                                
+                String rec = cmp.printRecord(fieldIter);
+                print(rec + "\n");          
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -498,10 +494,9 @@
         try {
             while (rangeCursor.hasNext()) {
                 rangeCursor.next();
-                byte[] array = rangeCursor.getPage().getBuffer().array();
-                int recOffset = rangeCursor.getOffset();                
-                String rec = cmp.printRecord(array, recOffset);
-                print(rec + "\n");         
+                IFieldIterator fieldIter = rangeCursor.getFieldIterator();                                
+                String rec = cmp.printRecord(fieldIter);
+                print(rec + "\n");    
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -736,15 +731,15 @@
         searchCmps[0] = IntegerBinaryComparatorFactory.INSTANCE.createBinaryComparator();
         MultiComparator searchCmp = new MultiComparator(searchCmps, fields);
         
-        RangePredicate rangePred = new RangePredicate(false, lowKey, highKey, searchCmp);
+        // TODO: check when searching backwards
+        RangePredicate rangePred = new RangePredicate(true, lowKey, highKey, searchCmp);
         btree.search(rangeCursor, rangePred, leafFrame, interiorFrame);
 
         try {
             while (rangeCursor.hasNext()) {
                 rangeCursor.next();
-                byte[] array = rangeCursor.getPage().getBuffer().array();
-                int recOffset = rangeCursor.getOffset();                
-                String rec = cmp.printRecord(array, recOffset);
+                IFieldIterator fieldIter = rangeCursor.getFieldIterator();                                
+                String rec = cmp.printRecord(fieldIter);
                 print(rec + "\n");
             }
         } catch (Exception e) {
@@ -881,9 +876,8 @@
         try {
             while (scanCursor.hasNext()) {
                 scanCursor.next();
-                byte[] array = scanCursor.getPage().getBuffer().array();
-                int recOffset = scanCursor.getOffset();                
-                String rec = cmp.printRecord(array, recOffset);
+                IFieldIterator fieldIter = scanCursor.getFieldIterator();                                
+                String rec = cmp.printRecord(fieldIter);
                 print(rec + "\n");
             }
         } catch (Exception e) {
@@ -922,9 +916,8 @@
         try {
             while (rangeCursor.hasNext()) {
                 rangeCursor.next();
-                byte[] array = rangeCursor.getPage().getBuffer().array();
-                int recOffset = rangeCursor.getOffset();                
-                String rec = cmp.printRecord(array, recOffset);
+                IFieldIterator fieldIter = rangeCursor.getFieldIterator();                                
+                String rec = cmp.printRecord(fieldIter);
                 print(rec + "\n");
             }
         } catch (Exception e) {
