make a function that maps the account id and deletes the function instead of iterating the list twice