fixed small bug that caused misleading logging, added unit test
created test client. squashed a couple bugs. added some more logging