done more tests and improved logging