added code to do the decomposition for a dataset