move target finding code into its own function
move target finding code into its own function

Mingling94/Sia,mharkus/Sia,mharkus/Sia,rivine/rivine,mtlynch/Sia,ericflo/Sia,mnsl/Sia,mnsl/Sia,ChrisSchinnerl/Sia,MrStrong/Sia,NebulousLabs/Sia,ChrisSchinnerl/Sia,mtlynch/Sia,MrStrong/Sia,johnathanhowell/Sia,rivine/rivine,NebulousLabs/Sia,cyrozap/Sia,ericflo/Sia,kustomzone/Sia