correct minor inefficiency in previous training 3.2. code.