 
   return false
 
-self.checkMove = (SpeciesData, FormeData, pokemon, forGeneration, move) ->
+checkMove = (looper, pokemon, move) ->
   {level} = pokemon
   valid = false
 
-  return true  if loopLearnsets forGeneration, SpeciesData, FormeData, pokemon, (learnset) ->
+  return true  if looper (learnset) ->
     # Check level-up, TM/HM, and tutors.
     return true  if learnset["level-up"]?[move] <= level ||
-                     learnset["machine"]?[move]  <= level ||
-                     learnset["tutor"]?[move]    <= level
+                    learnset["machine"]?[move]  <= level ||
+                    learnset["tutor"]?[move]    <= level
 
     # If the Pokemon can learn Sketch, then by golly, it can learn anything!
     # ... Except Chatter and Struggle. NOTE: Bogus moves are considered valid,
     # so you must take care of them at a higher level.
     return true  if learnset["level-up"]?["Sketch"] <= level &&
-                     move not in [ "Chatter", "Struggle" ]
+                    move not in [ "Chatter", "Struggle" ]
 
   # TODO: Skip unavailable Pokemon (due to being a generation later).
   # TODO: level-up moves can be bred.


# Loop through the learnsets for this pokemon and all prevolutions.
# This takes all available generations into count.
loopLearnsets = (forGeneration, SpeciesData, FormeData, pokemon, iterator) ->
  minimumGeneration = getMinimumGeneration(forGeneration)
  [name, formeName] = [pokemon.name, pokemon.forme]
  # Loop through formes

  # There are certain ways specific Pokemon can learn a move.
  # Check non-standard groups:
  # "form-change", "light-ball-egg", "stadium-surfing-pikachu"
  return true  if looper (learnset) ->
    # Check to see if special moves can completely overlap these moves
    learnsetGroups = (g  for g of learnset when g not in standardGroups)
    for groupName in learnsetGroups
