add SUM and COUNT function