FInally a working version, most probably full of bugs, but at least it managed to run without crashing !