Not sure what this snippet is supposed to do, but can probably be done better with list comprehension