Implemented neural network cost function, first pass