Final version of rmd

Some mistakes fixed