actsAsAnchor and actsAsLinkToAnchor
change function to be more general