functioned aggregate table computations

somehow could not get edits sync for my branch. Just copy and pasted the whole thing here...