   minGeneration = Math.min(unportableGenerations...)
   throw new Error("Gen. '#{generation}' must be greater than #{minGeneration}.")
 
-# Loop through the learnsets for this pokemon and all prevolutions.
-# This takes all available generations into count.
+# A helper method to loop through the learnsets for this pokemon and all
+# prevolutions, and then runs an iterator function (that you give) on those
+# learnsets. The iterator function takes one parameter, `learnset`, the learnset
+# for a given generation for the Pokemon's current forme.
+#
+# All generations that can be used are taken into consideration.
 loopLearnsets = (SpeciesData, FormeData, pokemon, forGeneration, iterator) ->
   minimumGeneration = getMinimumGeneration(forGeneration)
   [name, formeName] = [pokemon.name, pokemon.forme]

  # through level-up, tutoring, machines, or Sketch.
  leftoverMoves = (m  for m in moves when !checkMove(looper, pokemon, m))

  # If there are no leftover moves, then we're done, the moveset is valid.
  return true  if leftoverMoves.length == 0

  standardGroups = [ "level-up", "tutor", "machine", "egg" ]

  # 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
      total = 0
      for move in leftoverMoves
        total += (if move of learnset[groupName] then 1 else 0)

      # If one group completely overlaps the leftover moves, we're good.
      return true  if total == leftoverMoves.length

  # TODO: Check chain-breeding.
  eggMoves = []
  looper (learnset) ->


  return false

# Checks a single move to see if the Pokemon can learn it through level-up,
# tutors, machines, Sketch, or pre-evolutions.
checkMove = (looper, pokemon, move) ->
  {level} = pokemon
  valid = false
