BROKEN Implementing endpoint lookup algo. Kinda have idea on how to do 1 pass over blocks