constructed general summarising function