Added function template to median.cc