Implemented read/write for leaf and nonleaf nodes. Needs testing