sorting communities table