added proper logging facilities.