Add schemas code

`counts.map { case (c, i) => ... }`.