Submission of assignment 2

Added more comments, to make it more readable and understandable.