added debug functions