restructure brute-furce motion search to be a lot more compact and more readable (IMO). Also gives a small speed boost.