adding debug functions.