Added get_buckets_flat() method and ordering buckets by label