fix horrible bug in neural network sim