implement a couple of diagnostic functions