removed unnecessary variable and .length