Currently a brute-force method, going to replace this with a Markus Khun-esque interval search shortly.