Ok, the typo in the phi expression is fixed.  This is ready to start looping