add phase1 and phase2 skeleton class and basic algorithm