Complete functions add toString and hashcode
Merge all with typecheckings