improved generateattendinglist by making it more generic