adding docs and more logging