begin nn implementation