new code from Nema