Shortening code

Using list comprehension