nit: no spaces after function-like constructs such as compact `compact (` should be `compact(`.