more cleanup, adjust a* to take path cost into account