Simplified resize code