add factorial method