More work on the resize function.