Adding more efficient version.