adding func snippet