Replacing list with generator compherension