sorting joints and jmcs