created algorithm for creating a minimal persistence graph; finished control loop