added minAbs & min
changed max value type from int to double