Added templates for the functions in serial.