slightly simplified visibility check
slightly more simplified visibility check plus renamed map for clarity