functioning, but about 10 times slower than default enumerate