use std algorithm, and as a side effect, remove initializer list (not supported by VC11)