Implemented programming assigment 2