adding hashcode and equals for the type key