more Anchor implementation and tests