Added code and commenting for assignment 2.