added graph data trimming functions, need to test