fixed for -ve max sum