Re-wrote the generator again