solution for flow control exercise 5; 3 files in one