first incomplete version (but almost compiling...)