Further work on Giovanni's optimization.