Isn't type an index?  May make more sense if you renamed it.