closing with threshold for clousing polygon as a parameter