almost finished hmap gen