Added methods to convert generator to arrays.