changes for distributed mode
fixed comments