Updated the logging and implemented connections