Improving the ego network script