A Logical Way of Ordering the Hexagrams of the Yijing and the Trigrams of the bagua