changed MAX_NUM_LEAVES constant

should improve performance