Added ascending descending check