wrong version of compact
named functions shouldn't be closures