A faster version

A faster version