Fix count logic from previous
Convert some temporary list expressions to generators