rewrite bp neural network