removed repeated lines of code.