almost working generator