nfa build working again, refactored