added comments explaining whether the function can be tranformed using list comprehension