Added pseudo code to stage 1