added logging, fixed up some documentation