public boolean equals(Object other){
    if(this == other) return true;
    if(!(other instanceof Position)) return false;
    Position pos = (Position)other;
    return (this.x == pos.x && this.y == pos.y);
  }