Attempt at creating matrix R.