a simple c style A*