added phi function. stated final M