implemented the gettorrent function