fixed a pretty serious error in the normalization step, and added a method for DataArrays