getting rid of misplaced line of code