code passes linter
Further cleanup and code comments