Break challenge1s single function into three separate functions