Changed '== None' to 'is None' for PEP8 compliance