This is quite a complex task to be done right and optimal, should be implemented after the move to #12
This is quite a complex task to be done right and optimal, should be implemented after the move to #12