Update psi function, slight change to PIRapp_tests