Extra brackets

Need to have brackets around equality checks to prevent the index of the array `string` to be out of range.