improved visibility detection