Modified the resizing routines