adding the nlcs helper code