sumST using ST monad.