added debug() function.