canged R codes for version 3