some unknown fixes, still ugly& buggy code