add generateBackgrid Method and update example