fixed some bugs; added outlier function to take care of any outlier dimension