Added type comparison. The actual interface for this part still needs work.