debug.c : handy functions to use for debugging