Extremal Kähler Metrics and Hamiltonian Functions