Add copyMap method, add jsdocs.