The foil accounting system