implement mark function