Fixed checkIfCoorinatesAreEqual method