variables naming changed + delete unused extern variables