obj2map equivalent with prewalk. cleaned up2.