snippet create function