Rewrote in golang. Significantly faster than ruby (4s vs 14s)