generalized code to test any checkpoint