Merge Alex's changes and remove Ning's unrelated changes