phi is now a 1d array