I placed my solution to the R file