Probably more correct version of A*

Thanks, Wikipedia...