function factorial x if (== 1 x) return 1 else return (* x (factorial (- x 1)))