Programming assignment - I Added two functions