added ascending check