D* implementation on javascript