added part on variable scope