Improved and extended pairorient and Ksector.