old fashioned nbem implementation