Change how next target is selected.

Added getNextTarget function to accomplish this. Chooses next target by
getting the target with the cheapest cost.