implemented phase2