gros rework thanks to pycharm