implemented resizing