isAscending() method updated