working neural net implementation