Added resize function.