created sum method