First step: working
Not everything has been tested yet.
Todo: add documentation.