added sort
added or cond