Fixed the general structure for a generator and removed some unused stuff