Added base conversion code