implemented regular for loops where I had originally done comprehensions