style nit: `all(d is 'n' for d in dist)`