Update comments, format and improvements