Commented assignMapToGrid