Added logger and debug output