added for statement around line 89