General code stuff for Coursera R Programming course