Updated code and comments

Updated code and comments