Changed peers to an arraylist, cleaned up code