adding debug functions