implement basic part of swarm library