Endohedral motions inside capped single-walled carbon nanotubes