Add more for-comprehension for three way loop