added remove snippet function