creation of a main function in R and in C.