seemingly working multi target algorithm.