added tests and corrected equality operator