Made comments to socketMain and removed unnecessary lines and variables