working version for compilation.

Note : packaging not tested