I just improved the comprehension code as well using the same idea as your code, eliminating an entire list!