quick implementation of auto-training
WARNING: untested