Completed first pass over tiling buildmap() function