Added digitToValue and convertToBase