My attempt to complete the assignment