Changed bounds if statement to fix bug.