pad_data() updated fully, minor change may be required.