renaming psi_n() -> state() (as it sometimes means psi[n+1]...)