modified var name and removed redundant var