Added case where intersection of lines occurs outside range(x), in which case a 4-sided polygon is drawn