fixing layout to use stored edge data and fixing tests