exspand regex terms and work on graph layout and function