added a fill_flattened_form