Update readme
Convert readme to Rmd

And fix lots of problems with the code