Checking the md and starting the R part