improve calculation of phi for ring rotation