wrote contiguity_check