Sum method that takes a block parameter