training method implemented! Doesn't work well though...