First implementation. I need to make some more tests.