some debugging functions