read in a loop