added template datatype for algorithms