Added scaling to min and max value. Not ok yet.