replaced Nmacros with LENGTH(x) macro