latest update to R codes