remove duplication when removing from openList and simplify checking of existing coordinate gcost