working on the path state machine