working on problem 4 - control flow