added code from reordering table view controller