Functionnal version

a few bug still to correct