added setof and bagof as alternative way to retrieve results