added r code so others don't have to compile the program