implementation of nlnca seems correct