Add error handling and delete print and screenshot statements
Add error handling and delete deprecated code
Replace %.% with %>% operator