Code for BitTorrent