First version of generator