Added a recursive factorial function