made a factorial function using recursion