basic but working generator