added equality tests and made checkString method private