Earlier thing would give an error if the value of i.state is None.
bstr would become somethin like 'None1' which you cannot convert to integers later (for example in line 71)!