Algebraic Models For Accounting Systems