converting flowchart to pseudocode - Search