this is by far not done and the implementation is not correct in many ways, but it is still something