function factorial(n) {