Many changes. Reporting implemented. Bugs in training algorithm fixed.