added generateMap method