replace princomp function