fix for psi calculations