Added code and comments

Added code and comments for programming assignment 2
fixed conflict

fixed conflict