gridded code, and some reclassing