add factorial calculation