implement a new input generator for better performance