int test4( ) throws MiniDB_Exception{
    int points = 0;
    // IN_SOLUTION_START

    MiniDB db = new MiniDB( "minidb.test4" );
    BufMgr bm = db.getBufMgr();
    BPlusTree bpt = db.createNewBPlusTreeIndex( "table", "val", 8 );
    BPlusTreeLeafNode leaf = (BPlusTreeLeafNode)bpt.getRootNode();
    int slot;
      
    slot = leaf.getSlotForValue( 15 );  
    System.out.println( "getSlotForValue( 15 )" );
    System.out.println( "Expect 0, got " + slot );
    if( slot == 0 ){	points++;   }else{ System.out.println( " incorrect" ); }
    
    System.out.println( "insertRecord(500,15)" );
    bpt.insertRecord(500, 15);

    slot = leaf.getSlotForValue(300);  // should be 0
    System.out.println( "getSlotForValue(300)" );
    System.out.println( "Expect 0, got " + slot );
    if( slot == 0 ){	points++;   }else{ System.out.println( " incorrect" ); }

    slot = leaf.getSlotForValue(500);  // should be 0
    System.out.println( "getSlotForValue(500)" );
    System.out.println( "Expect 0, got " + slot );
    if( slot == 0 ){	points++;   }else{ System.out.println( " incorrect" ); }

    slot = leaf.getSlotForValue(700);  // should be 0
    System.out.println( "getSlotForValue(700)" );
    System.out.println( "Expect 1, got " + slot );
    if( slot == 1 ){	points++;   }else{ System.out.println( " incorrect" ); }

    if( points == 3 ){
      long checkLong = leaf.readLong( leaf.offset_valueSlot(0) );
      if( checkLong != 500 ){
	System.err.println( leaf.toString() );
	System.err.println( "check failed in MiniDB_grade, 500 is 0x1F4 in hex" );
	System.exit(0);
      }
    }
    
    // Add some values (all less than 500 );
    long valuesInsert[] = {2, -10, 20, -5, 7};

    long valuesGet[] = {-30, -10, 0, 2, 5, 100000};
    int expectedSlots[] = {0, 0, 2, 2, 3, 6};

    for (int i=0; i<valuesInsert.length; i++){
      long value = valuesInsert[i];

      int blockID = (i+1)*100;
      bpt.insertRecord(value, blockID);
      System.out.println( "insertRecord(" + value + "," + blockID + ")" );
      
      MiniDB_Record rec = new MiniDB_Record(blockID,value);
      System.out.println( "Inserted " + rec );
    }
    
    for (int i=0; i<valuesGet.length; i++){
      System.out.println( "getSlotForValue(" + valuesGet[i] + ")" );
      slot = leaf.getSlotForValue(valuesGet[i]);  
      System.out.println( "Expect " + expectedSlots[i] + ", got " + slot );
      if( expectedSlots[i] == slot ) points++; else{ System.out.println( " incorrect" ); }
    }

    // IN_SOLUTION_END
    return points;
  }