wrote a tutorial for functions