training logic added