Making classes Serializable. Implemented equals and hascode methods.