Tweaked seach algorith slightly, needs work still