how to compute the kinetic energy