implements query, from, to, size methods