var cap = [16, 5, 3]
var max = cap.reduce( (a, b) => Math.max(a,b))
var maxIndex = cap.indexOf(max)
cap.splice(maxIndex, 1)
var min = cap.reduce( (a, b) => Math.min(a,b))
var minIndex = cap.indexOf(min)
cap.splice(minIndex, 1)
var remainder = cap[0]
var ret
// [x, y, z] == x+y, y+z, x+z
// [x, x, z] == x+x, x+z
// [x, x, x] == x + x + x