completed the assignment from stub file