Made number of traits a parameter to be passed from R