main initialize compute terminate initialize openInputFile compute phaseOne phaseTwo terminate closeInputFile closeOutputFile phaseOne phaseTwo phaseOne phaseThree compute terminate