adding OOP version of neural network version 1