Added the factorial method