Added is_visible algorithm