double test7( ) throws MiniDB_Exception{
    double points = 0;
    // IN_SOLUTION_START

    MiniDB db = new MiniDB( "minidb.test7" );
    BufMgr bm = db.getBufMgr();
    int size = 8;
    BPlusTree bpt = db.createNewBPlusTreeIndex( "table", "val", 8 );

    int iters = 300;
    java.util.Hashtable val2blk = new java.util.Hashtable();
    MiniDB_Record insertedRecords[] = new MiniDB_Record[iters];

    System.out.println( "At start, " + db.numBlocksInDB() + " blocks " );

    // add a bunch of values
    for (int i=0; i<iters; i++){
      //long value = -i*2;
      long value = ((int)Math.pow(-1, i))*i*2;
      int blockID = (i+1)*100;
      MiniDB_Record rec = new MiniDB_Record(blockID, value);

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

      System.out.println( "insert " + rec );
      System.err.println( "insert " + i + ") of " + iters + ", " + rec );
      // System.out.println( "After " + (i+1) + ", " + db.numBlocksInDB() + " blocks " );

      //
      //System.out.println( "i is " + i + ", Inserted value " + value + ", block " + blockID );
    }

    System.out.println( "+ 0.5 points for not crashing so far" );
    System.err.println( "+ 0.5 points for not crashing so far" );
    points = 0.5;

    int expectedVal = 84;
    int testVal = db.numBlocksInDB();
    System.out.println( "Number of blocks in DB is " + testVal + ", expected " + expectedVal );
    if( expectedVal == testVal ){  points++; System.out.println( "  +1" );    }else{ System.out.println( " incorrect" );   }

    BPlusTreeNode nodes[] = bpt.getPathForValue( 0 );
    expectedVal = nodes.length;
    testVal = 4;
    System.out.println( "Height of tree is " + testVal + ", expected " + expectedVal );
    if( expectedVal == testVal ){  points++; System.out.println( "  +1" );  }else{ System.out.println( " incorrect" );   }

    MiniDB_Block blk =  bpt.getRootNode();
    expectedVal = MiniDB_Block.BLOCK_TYPE_BPT_INTERNAL;
    testVal = blk.getBlockType();
    System.out.println( "Block type is " + testVal + ", expected " + expectedVal );
    if( expectedVal == testVal ){ System.out.println( "  +1" );  points++;   }else{ System.out.println( " incorrect" );   }

    // get all values
    Arrays.sort( insertedRecords );
    Vector vValues = new Vector();
    Vector vBlkIDs = new Vector();
    bpt.getAll( vValues, vBlkIDs );
    int numCorrect = 0;
    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 ) ){
	numCorrect++;
      }
      else{
      }
    }

    double pointsPart2 = 10.0* (numCorrect / (double)iters);

    System.out.println( "     " + points + " for structure checks " );
    System.out.println( "   + " + pointsPart2 + " for getting " + numCorrect + " of " + iters + " lookups correct." );

    points += pointsPart2;

    System.out.println( " totl for split() test --> " + points );

    // IN_SOLUTION_END
    return points;
  }