Changing String.contains() to indexOf()