This seems like it's going to continue appending to this list forever. Maybe make it a set, or move its definition inside the function.