insertAnchors method created