Modified code so method pearson and baseline can be swapped