add more documentation
refactor, expose fi.hat for Huang 2004
declare needed functions
implement phi_3.gen