Added helper methods to enumerate all possible combinations R.