implement assignment 2