added factorial function option