#11 basic implementation of peer selection algorithm