Trying to implement document type detection
Yada yada
Got the item type detection working