Added ability to deal with negative data values.