adding logic for summary calculations