Added debug function