some fixes, almost ready