Added ascending flag

Added ascending flag to ordered or reversed array