adds docs and log statements and tests