Feature/optimize

Use depth count instead of array lookup to shave ~400ms from `pack` using project benchmark.