Scala version of accounting