added credit for debug function