modified brain.js used in NN example