Implemented assignment 2