print summary table to json also
add new discriminators, move quad to a more reasonable place
code refactoring