Added logging functionality to the latest version and removed all old logging. Test cases still need to be written.