Changed Generator for better performance.