Added toString, equals, and hasCode methods.