public void decodeCharacter (StringBuffer buffer, String msg, int offset)
    {
        if (offset >= msg.length())
            return;

        if (decoder.get(msg.charAt(offset)) instanceof Object[]) {
            Object[] array = (Object[]) decoder.get(msg.charAt(offset));
            for (int k = 0; k < array.length; k++) {
                if (!decodedSet.contains((Character) array[k])) {
                    buffer.delete(offset, buffer.length());
                    buffer.insert(offset, (Character) array[k]);
                    decodeCharacter(buffer, msg, offset + 1);
                    String temp = buffer.toString();
                    if (dict.get(temp.length()).contains(temp)) {
                        decoder.put(msg.charAt(offset), temp.charAt(offset));	
                        decodedSet.add(temp.charAt(offset));
                        return;
                    }
                }
            }
            //System.out.println("**WARNING no character found"); 		
        } else {
            buffer.append((Character)decoder.get(msg.charAt(offset)));
            decodeCharacter(buffer, msg, offset + 1);
        }	
    }