add a loop that closely resembles a for loop