start of safe-clause testing code