* improved resizing code