Create factorial funcion