some resizing magic