Functional version with target list.