use an indexed collection to get away from the need to loop the whole thing