Ready to Merge, with Errors.

Its ready to merge but contains a lot and lot of error.
please correct the 'ip addresses' and 'port'.
and the code really ugly and for some views there are two, three returns (to be corrected).
I havn't runned it yet because have trouble in installing the mininet .