changed loops to use comprehension for more idiomatice coffee