basic working generator