working on layering system for graphs