Added automatic grid mapping, now you just add function to the two objects