order: implemented total order $ calculation