First version of grid generator