new code for finding closed M7s (doesn't work yet)