Added sorting by sequence number, to make sure steps are in correct order