use references in for loop to iterate over vector