Correct use of multiple parameters for the statement
Added groupBy and orderBy functions