fixing neural net code (database part at least).