example: implement sum and max functions