# Goldstein Classical Mechanics equation 8.20 clarification

In Goldstein (Third Edition, Page 339) the equation 8.20 is as follow:

$$H = \dot q_ip_i - L = \dot q_ip_i-[L_0(q_i,t)+L_1(q_i,t)\dot q_k+L_2(q_i,t)\dot q_k\dot q_m].\tag{8.20}$$

Can someone explain why the second equality hold? Moreover, $$H$$ is in no way a tensor, how come it has the last term indexed by $$km$$?

Note: by equation 2.55, the Lagrange can be decomposed as such: $$L(q,\dot q,t)=L_0(q,t)+L_1(q,\dot q,t)+L_2(q,\dot q,t).\tag{2.55}$$ where $$L_2$$ is a homogeneous function of the second degree, in $$\dot q$$, while $$L_1$$ is homogeneous of the first degree in $$\dot q$$.