misc. code for pivoting secondary structure stuff