now use cplus env var
fixed bugs