codebox: factorial function added