implemented nested expand queries and other progress