refactor tests and add graph illustrations