fix a bunch of distance and visibility related stuff.

it all makes sense now.