Added method prepare_data_for_stacking