added method to check for equality