added pseudocode to phase-2