Add R codes, class def & funct