Added debug function and debug implementation