Main parts done, some buggfixes left