Understanding friction has been the goal for many researchers, and although a lot is known about the factors contributing to friction, a complete picture of the origin of friction is still lacking. Besides mechanical based arguments (such as material properties), the influence of surface roughness on friction is an important topic in current tribology research. Due to this surface roughness the real contact area between two materials is much smaller than the apparent contact area. This is an important observation because the real contact area is directly proportional to the frictional force. Using molecular dynamics simulation we investigated two bodies in contact due to (repetitive) normal loading to better understand the physics at the atomistic scale. The two bodies can either be deformable or not and both having a rough surface or one of the bodies having a flat surface. Furthermore, we developed an algorithm to measure real-time important parameters, such as contact area and stress.