Collect ncode in advance