In Chapter 2 - added 'factorial' function and declared its type