added brute force next point function, could be much better, but this should work for now