Replace old resize logic with new, tested logic