rename expand_flat to expand_poly