done incorporating cvar.cpp