modified variable names in creategrid function