add two snippet functions