Updated code documention in comments and formatting