Console messages and log-file logic added