solution for flow_control exercise 1