new comments and code improvements