added grid generation and some extra parameters