Added debug logging to the OTF algorithm