added the rest of the logging stuff and unit tested everything.