neural network stuff mostly done