refactored connection,swarm and updated readme