updated to allow flexible source and targets.
updated to allow flexible source and targets.