Renamed and restructured.  Also fixed horrible crossover error in sga (only ever flipped first bit if ever).