with extensive comments