Improved the trainer

Still contains bugs