auto phasing collected into single function phase_auto()