More cache friendly implementation.