"working" version which does not work because of phi