adds groupby and sum query/ fixes #20 & #19