use map for reading edges