Added ability to set reference voltage