first fully functionnal version of maputfgrid.c