debug the collapse_data file and self_consistent loop