use std.algorithm: cmp