finding the factorial value