type recognition magic