Improved design of phi function