Fixed bugs within the code. Fixed the indexing algorithm to work with a model that includes faces of any vertex count (rather than assuming it has 4 verts).