working recursive version of factorial