some fixes, almost done now