Olivier's suggestion to speed up the code.