update for R version 3