I am given a non-recursive method, that I need to modify to make recursive. 

This is what I have so far: 

```
public class BaseN {

   public static final int BASEN_ERRNO = -1;

   public static void main(String[] argv) {

      Scanner input = new Scanner(System.in);
      System.out.print("enter number followed by base (e.g. 237 8): ");
      int number = input.nextInt();
      int base = input.nextInt();

      BigInteger answer = basen(number, base);
      System.out.println(number + " base-" + base + " = " + answer);
   }
   static BigInteger basen(int number, int base ) {

        List<Integer> remainder = new ArrayList<>();

        int count = 0;
        String result = "";
        while( number != 0 ) {
            remainder.add( count, number % base != 0 ? number % base : 0 );
            number /= base;
            try {
                result += remainder.get( count );
            } catch( NumberFormatException e ) {
                e.printStackTrace();
            }
        }
        return new BigInteger( new StringBuffer( result ).reverse().toString() );
    }
}

```

It's converting it to base 10 then the given base. I need it to convert to the given base first then base 10. 

---

UPDATE:
I changed around Caetano's code a bit and think I am closer. 

```
static String basen(int number, int base) {

String result = String.valueOf(number % base);
int resultC;
String resultD;

int newNumber = number / base;

if (newNumber != 0)
    result += basen(newNumber, base);
if (newNumber == 0)
  resultC = Integer.parseInt(result);
  resultD = Integer.toString(resultC);

return resultD;

```

Now when I compile it it gives me an error it says: 

```
BaseN.java:49: error: variable resultC might not have been initialized
  resultD = Integer.toString(resultC);

```

Am I on the right track here? Any help is appreciated