adding logging
more work on logging