First working version

It works! Still much to be done...