Molecular dynamics model of heavy ion collisions at medium energies