added weight adjustment for A*