added fnf method
refactored ff func