New version of phew almost working