Thanks for all the great comments! Right now I am trying to improve on the code so that when it finds a shadow it does not follow it. Turns out a whole bunch harder then I previously thought it was. I guess it kinda falls under the phrase, if it ain't broke don't fix it. Idk, the bug where it choses to chase shadows instead of light really bugs me though.