added some logging here and there. Removed the logfile.