helper function choose-var-name and few other corrections