Modified for cluster run.