removed duplicate lines of code