removed some redundant lines of code