implementing hashCode methods
fixing style
remove redundant casts
adding serialVersionUID