Added code and comments.