Added logging to program