read lines randomly, update sources