started generic mapping code