Distribution working, has bugs, not correct yet