Added the core code for network_interaction used in math thesis.