remove unused lines and add is_distributed flag to network