added lots of tests, got code coverage back to respectable level