Implementing the factorial function in a recursive way.