mostly working gridbased generation