Implemented assignment 2, following the instructions provided.