add a creategrid model function