add psi checking; start to implement a diff check wrt a given reference