you should keep ``sortedSteps`` initialized as ``null`` rather than ``array()``, and check for ``null`` specifically here: no sorting applied or no steps should not be treated the same