added some debugging information, logging and made some style changes