added back the logging stuff.