more asserts and more documentation
more logging