adding nn code