modified Person class function template