Got a* algorithm working for two witnesses. Can be further refined.