Changed the way the toString, hashCode and equals methods are
implemented.