Added support for different bases