fix peers method to return a flat array instead of an array of arrays