resolved tilde_phi and checked code