Inheritance: added methods equals(), toString(), hashCode() and some comments