resizing almost works right - still some bugs