Solution written in python and visualized with PySide