moved factorial function