Automatic code for detailed accounts

this is the solution