another unit test, code fixes, documentation
adding more guards