removed redundant for loop.