bug in trainign array