fixed bug in not maintaining all values as leaves.
fixed bug in not maintaining all values as leaves.