A-star works. Slightly less than optimal answer for some reason