add a self-testing function