rewrote reporting queries due to schema changes.