better doco
better logging