NFsim code for study