removed redundant for loop