move Learn for loops around