updated colors on graphs, restructured code