Added type comparison method