Modifed to make target and source locations more dynamic.