Take a look at this list comprehension, I'm pretty sure it can be simplified, but this was the best I was able to get working.