added double precision accumulator, templated