R with some modifications