implement assignment 3