Add factorial class