Fixed visibility checking to be much more reliable.
Added markers to visibility checking.