adding tests for coverage and fixing bugs they uncover
more code coverage