Adding orderBy and tests