added function to check test coverage, lots of debugging code in place