Working version of ncc_sample. Needs testing