reformatted code to please pycharm and replaced * == None with * is None throughout the project