cleanup, understanding changes
work on #7 and #14, adding function to check sign changes in phi happening at unexpected times