  We generalize the idea of "extension of Hamiltonian systems" -- developed in
a series of previous articles -- which allows the explicit construction of
Hamiltonian systems with additional non-trivial polynomial first integrals of
arbitrarily high degree, as well as the determination of new superintegrable
systems from old ones. The present generalization, that we call "modified
extension of Hamiltonian systems", produces the third independent first
integral for the (complete) Tremblay-Turbiner-Winternitz (TTW) system, as well
as for the caged anisotropic oscillator in dimension two.
