improve equals method.