sty: mostly formatting
doc fixes
Add random_pairs helper function