removed unused code and cginame variable