Added NF algorithm