refs #23 fixes map and optimization