updated to version working for R 3.1.3