minor conrrection on visibility algorithm