edited loop by reya_kundu | SimScale