laid out some pseudocode for exercise 3