some changes to contextPage. Make sure all anchors are in template (vs created dynamically.) Use classes rather than IDs as anchors, and search for them relative to current view. separate calculations and drawing.