Added snippet functionality