Molecular dynamics of rigid molecules