Added the auto-resize feature.