updated comments and formating