determinefip function