added all pseudocode to challenge 2