physics: minor adjustments to structure finding algorithm

Still very WIP. I'd rather find a way that didn't involve setting the loop parameters over and over again.