final version for offline sourcing