adding NeuralNetwork as well as minor restructuring