R-cube code