switched to pycharm and refactored/reformatted