Previous is really slow, copying Bostock better