abstracted map generation functions to gen.c