Resorted to a transaction block to resolve the (n+1) and (n+1)^2 queries