A molecular dynamics study of a nearly incommensurate overlayer on a metal substrate