added removing from peers list, keeping main thread alive, and better print messages