improved subquery() usage, added toString()