STM Graph implementation and example