Implemented assignment2