            int counterNonAdjacentNumerals=0;
            int valueNumeral=0;
            int[] valueNumerals = new int[2];
            boolean hasFilledNoneAdjacentNumerals=false;
            boolean hasInvalidNonAdjacent=false;
            
            //since we are checking two indexes ahead
            //the loop has to terminate three indexes from end
            for (int n=0; n<(numeralsToString.length()-2);n++)
            {
                //variable used so that comparison is made once it retrieves two numerals and conversion 
                //to decimal
                counterNonAdjacentNumerals=0;
                
                //we want to run the switch statement for non-adjacent characters
                //it will run twice total for each inputtedNumerals
                for (int y=n;y<(n+3);y=y+2)
                {
                    counterNonAdjacentNumerals++;
                    
                    System.out.println("Retrieving numeral: " + numeralsToString.charAt(y));
                    
                    //We could have also performed reference against acceptedNumerals array
                    //However using swithc allow us to get the actual numerical value of the numeral.
                    //More relevant screen output
                    
                    switch (numeralsToString.charAt(y))
                    {
                        case 'I':
                        valueNumeral=1;
                        break;

                        case 'V':
                        valueNumeral=5;
                        break;
                            
                        case 'X':
                        valueNumeral=10;
                        break;

                        case 'L':
                        valueNumeral=50;
                        break;
                            
                        case 'C':
                        valueNumeral=100;
                        break;

                        case 'D':
                        valueNumeral=500;
                        break;
                            
                        case 'M':
                        valueNumeral=1000;
                        break;

                        default:
                        System.out.println("Do not reach here");
                    }
                    
                    //it stores the first numeral in the array
                    if (counterNonAdjacentNumerals==1)
                    {
                        valueNumerals[0]=valueNumeral;
                    }
                    //it stores second numeral in array
                    else if (counterNonAdjacentNumerals==2)
                    {
                        valueNumerals[1]=valueNumeral;
                    }
                    
                    //at this point, we can to check if
                    //valueNumerals[0] is less than or equal to valueNumerals[1]
                
                    //System.out.println("VALS0: " + valueNumerals[0]);
                    //System.out.println("VALS1: " + valueNumerals[1]);
                    //System.out.println(counterNonAdjacentNumerals);
                
                    if (counterNonAdjacentNumerals==2)
                    {
                        //it is ok if the left most numeral is same or greater.  We know MCM is fine for instance
                        //or XVI
                        if (valueNumerals[0]>=valueNumerals[1])
                        {
                            System.out.println("1HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
                        }
                
                        //anything else is not allowed such as CXD
                        else
                        {
                            System.out.println("INVALID NUMERAL: " + numeralsToString.charAt(n) + 
                            " = " + valueNumerals[0] + "(index: " + y +")"
                            + " is less than: " + numeralsToString.charAt(n+2) + " = " +  
                            valueNumerals[1] + "(index: " + (y+2) +")");
                            
                            hasInvalidNonAdjacent = true;
                            //validNumber=false;
                            System.out.println("2HERE1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
                        }
                    }
                }
                
                //reset the variable
                valueNumerals = new int[2];
                hasFilledNoneAdjacentNumerals=false;
                counterNonAdjacentNumerals=0;
            
                //we had to create another boolean and could not set validNumber above.
                //This is because there might be subsequent numerals which pass above condition
            }
            
            //This is only circumstance we know the numeral is valid.
            //When it has not had any violations in the above new code
            if (!hasInvalidNonAdjacent)
            {
                validNumber=true;
            }
            
            //variable has been reset now due to other numeralsToString which might be called as part of the for
            //loop at top of code.
            hasInvalidNonAdjacent=false;