int test5() throws MiniDB_Exception{
    int points = 0;
    // IN_SOLUTION_START
    MiniDB db = new MiniDB( "minidb.test5" );
    BufMgr bm = db.getBufMgr();
    int size = 8;
    BPlusTree bpt = db.createNewBPlusTreeIndex( "table", "val", 8 );
    int iters = 50;
    MiniDB_Record insertedRecords[] = new MiniDB_Record[iters];
    Random rng = new Random( 339 );
    int cntCorrect = 0;

    // Add some records. It will require splits of leaf nodes but not internal nodes
    System.out.println( "insert " + iters + " records to create multiple leaf nodes, but no internal nodes" );
    for (int i=0; i<iters; i++){
      long value = (long)rng.nextInt( 10000 );
      int blockID = (i+1)*100;

      bpt.insertRecord(value, blockID);
      
      MiniDB_Record rec = new MiniDB_Record(blockID,value);
      insertedRecords[i] = rec;

      System.out.println( "Inserted " + rec );
    }

    //System.out.println( "\nB+Tree after all values inserted: " );
    //System.out.println( bpt.allTreeValuesToString() );
      
    System.out.println( "\n BPlusTree.getAll() \n" );

    // get all values
    Arrays.sort( insertedRecords );

    Vector vValues = new Vector();
    Vector vBlkIDs = new Vector();
    bpt.getAll( vValues, vBlkIDs );

    for (int i=0; i<iters; i++){
      Long lVal = (Long)vValues.get(i);
      Integer iblockID = (Integer)vBlkIDs.get(i);
      
      MiniDB_Record recGot = new MiniDB_Record( iblockID, lVal );
      MiniDB_Record recExp = insertedRecords[i];
      
      System.out.println( "expected " + recExp + ", got " + recGot );
      if( !recGot.equals( recExp ) ){
	System.out.println(" error" );
      }
      else{
	cntCorrect++;
      }
    }

    points = cntCorrect / 5; // the only way to get all ten points is to be perfect
    //points = (int)Math.ceil( (cntCorrect - 4) / 5.0 ); // the only way to get all ten points is to be perfect
    if( points == 0 && cntCorrect > 0 ) points = 1; // mercy point if any are correct
  
    System.out.println( "" + cntCorrect + " of " + iters + " correct ---> " + points + " points of " + maxByTest[5] );

    if( points == maxByTest[5] ){
      // Check submissions that got all the points that there wasn't any funny business going on.

      int leafBlocks[] = bpt.getLeafBlockIDs();
      int cnt = 0;
      
      for (int i=0; i<leafBlocks.length; i++){
	MiniDB_Block blk = db.bufMgr.pin_block( leafBlocks[i] );
	BPlusTreeLeafNode leafNode =  new BPlusTreeLeafNode( blk, bpt, false );
	
	for (int slotID=0; slotID<leafNode.getCurrNumRecordsOnBlock(); slotID++){
	  long val = leafNode.getValue(slotID);
	  int blkID = leafNode.getBlockID(slotID);
	  MiniDB_Record recGot = new MiniDB_Record( blkID, val );
	  MiniDB_Record recExp = insertedRecords[cnt++];

	  if( recGot.equals( recExp ) ){
	  }
	  else{
	    System.out.println( leafNode.toString() );
	    System.out.println( "leaf node " + i + " of " + leafBlocks.length );
	    System.out.println( "deception test, expected " + recExp + ", got " + recGot );
      	    System.out.println( "decpeption test failed " );
	    System.exit(0);
	  }
	}

      }

      System.out.println( "DTst ok" );
    }


    // IN_SOLUTION_END
    return points;
  }