Rewrote reach function for performance

- No more solve
- Only index on the new nodes instead of all the nodes.