updated code to loop over an array of accounts. amends file with current account heading too