Made the program faster and it now survives R CMD check