add function snippet