pattern matching and tail recursion examples added