changed to max - min