added some debugging functions