resultscase modified to produce phi output