Partly finnished #8

This still need checking that it works