Problem 3 - pseudocode