Refined version for lambda term generator

  Still problems combining partial results.