revamped tutorial, added pure R file and edited md